emhaihsan/llm-evaluation-dashboard
0
LLM Evaluation Metrics Dashboard

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

๐ฏ Features
5 Complete Metric Implementations
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
# 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.pyOnline 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
- Go to Overview page
- Paste reference translation
- Paste candidate translation
- Click "Compare All Metrics"
- See radar chart showing BLEU, ROGUE, and BERT Score
Evaluate Summarization Quality
- Go to ROGUE Score page
- Select "ROGUE-L" variant
- Enter original article as reference
- Enter summary as candidate
- Check LCS (Longest Common Subsequence) visualization
Test Question Answering
- Go to MRR page
- Enter question and correct answer
- Enter ranked model outputs
- 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)
