CoolFace
Apppublic

emhaihsan/llm-evaluation-dashboard

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

LLM Evaluation Metrics Dashboard

![Streamlit App](https://huggingface.co/spaces/emhaihsan/llm-evaluation-dashboard)

A comprehensive educational dashboard demonstrating 5 key NLP evaluation metrics with interactive visualizations and mathematical explanations.

Dashboard Preview

๐ŸŽฏ Features

5 Complete Metric Implementations

MetricFocusUse Case
BLEUN-gram PrecisionMachine Translation
ROGUEN-gram Recall (5 variants)Text Summarization
PerplexityModel ConfidenceLanguage Modeling
MRRRanking QualityQuestion Answering
BERT ScoreSemantic SimilarityParaphrase Detection

Interactive Visualizations

  • โ€”๐Ÿ“Š Radar charts for multi-metric comparison
  • โ€”๐Ÿ“ˆ Bar charts for precision/recall breakdown
  • โ€”๐Ÿ”ฅ Heatmaps for token-level similarity
  • โ€”๐ŸŽš๏ธ Gauge charts for score visualization
  • โ€”๐Ÿ“ Step-by-step calculation breakdowns

Educational Focus

  • โ€”๐Ÿงฎ Mathematical formulas with LaTeX rendering
  • โ€”๐Ÿ” N-gram matching visualizations
  • โ€”๐ŸŽ“ Preset examples for quick learning
  • โ€”๐Ÿ’ก Quality interpretations for each score

๐Ÿš€ Quick Start

Local Installation

bash
# Clone the repository
git clone https://github.com/emhaihsan/llm-evaluation-dashboard.git
cd llm-evaluation-dashboard

# Install dependencies
pip install -r requirements.txt

# Download NLTK data
python -c "import nltk; nltk.download('punkt')"

# Run the app
streamlit run app.py

Online Demo

Visit the live demo: HuggingFace Spaces

๐Ÿ“ Project Structure

llm-evaluation-dashboard/
โ”œโ”€โ”€ app.py                          # Main entry point
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ 01_overview.py              # All metrics comparison
โ”‚   โ”œโ”€โ”€ 02_bleu_score.py            # BLEU with n-gram viz
โ”‚   โ”œโ”€โ”€ 03_rogue_score.py           # 5 ROGUE variants
โ”‚   โ”œโ”€โ”€ 04_perplexity.py            # Token-level perplexity
โ”‚   โ”œโ”€โ”€ 05_mrr.py                   # Ranking evaluation
โ”‚   โ””โ”€โ”€ 06_bert_score.py            # Semantic similarity
โ”œโ”€โ”€ modules/
โ”‚   โ”œโ”€โ”€ metrics/                    # Metric implementations
โ”‚   โ”‚   โ”œโ”€โ”€ bleu.py
โ”‚   โ”‚   โ”œโ”€โ”€ rogue.py
โ”‚   โ”‚   โ”œโ”€โ”€ perplexity.py
โ”‚   โ”‚   โ”œโ”€โ”€ mrr.py
โ”‚   โ”‚   โ””โ”€โ”€ bert_score.py
โ”‚   โ”œโ”€โ”€ visualizations/             # Plotly charts
โ”‚   โ”‚   โ”œโ”€โ”€ charts.py
โ”‚   โ”‚   โ””โ”€โ”€ explanations.py
โ”‚   โ””โ”€โ”€ utils/                      # Helpers
โ”‚       โ”œโ”€โ”€ text_processing.py
โ”‚       โ””โ”€โ”€ examples.py
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ sample_evaluations.json     # Test cases
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐ŸŽ“ Learning Resources

BLEU Score

  • โ€”Bilingual Evaluation Understudy
  • โ€”N-gram precision (1-4 grams)
  • โ€”Brevity penalty for short outputs
  • โ€”Best for: Machine translation

ROGUE Score (5 Variants)

  • โ€”ROGUE-N: Unigram/bigram overlap
  • โ€”ROGUE-L: Longest Common Subsequence
  • โ€”ROGUE-S: Skip-bigram matching
  • โ€”ROGUE-SU: Skip + Unigram combined
  • โ€”ROGUE-W: Weighted consecutive matches
  • โ€”Best for: Text summarization

Perplexity

  • โ€”Model confidence metric
  • โ€”Lower = more confident
  • โ€”No reference needed
  • โ€”Best for: Language model evaluation

MRR (Mean Reciprocal Rank)

  • โ€”Ranking quality metric
  • โ€”1/rankofcorrect_answer
  • โ€”Batch evaluation support
  • โ€”Best for: Question answering / IR

BERT Score

  • โ€”Contextual embedding similarity
  • โ€”Semantic vs lexical matching
  • โ€”Token-level alignment
  • โ€”Best for: Paraphrase detection

๐Ÿ’ป Usage Examples

Compare Two Translations

  1. 1.Go to Overview page
  2. 2.Paste reference translation
  3. 3.Paste candidate translation
  4. 4.Click "Compare All Metrics"
  5. 5.See radar chart showing BLEU, ROGUE, and BERT Score

Evaluate Summarization Quality

  1. 1.Go to ROGUE Score page
  2. 2.Select "ROGUE-L" variant
  3. 3.Enter original article as reference
  4. 4.Enter summary as candidate
  5. 5.Check LCS (Longest Common Subsequence) visualization

Test Question Answering

  1. 1.Go to MRR page
  2. 2.Enter question and correct answer
  3. 3.Enter ranked model outputs
  4. 4.See reciprocal rank calculation

๐Ÿ› ๏ธ Tech Stack

  • โ€”Framework: Streamlit
  • โ€”Visualizations: Plotly, Matplotlib
  • โ€”NLP: NLTK
  • โ€”Metrics: rouge-score, bert-score, sentence-transformers
  • โ€”Math: NumPy, Pandas

๐Ÿ“ Implementation Notes

Educational Simplifications

  • โ€”Perplexity: Uses probability simulation (real calculation requires model logprobs)
  • โ€”BERT Score: Uses simplified embeddings (install sentence-transformers for full BERT)
  • โ€”Tokenization: Simple word-based (no subword tokenization)