eo / README.md
omarkamali's picture
Upload all models and assets for eo (latest)
fc5e5b5 verified
---
language: eo
language_name: Esperanto
language_family: constructed_auxlang
tags:
- wikilangs
- nlp
- tokenizer
- embeddings
- n-gram
- markov
- wikipedia
- feature-extraction
- sentence-similarity
- tokenization
- n-grams
- markov-chain
- text-mining
- fasttext
- babelvec
- vocabulous
- vocabulary
- monolingual
- family-constructed_auxlang
license: mit
library_name: wikilangs
pipeline_tag: text-generation
datasets:
- omarkamali/wikipedia-monthly
dataset_info:
name: wikipedia-monthly
description: Monthly snapshots of Wikipedia articles across 300+ languages
metrics:
- name: best_compression_ratio
type: compression
value: 4.413
- name: best_isotropy
type: isotropy
value: 0.7822
- name: vocabulary_size
type: vocab
value: 0
generated: 2026-01-11
---
# Esperanto - Wikilangs Models
## Comprehensive Research Report & Full Ablation Study
This repository contains NLP models trained and evaluated by Wikilangs, specifically on **Esperanto** Wikipedia data.
We analyze tokenizers, n-gram models, Markov chains, vocabulary statistics, and word embeddings.
## ๐Ÿ“‹ Repository Contents
### Models & Assets
- Tokenizers (8k, 16k, 32k, 64k)
- N-gram models (2, 3, 4, 5-gram)
- Markov chains (context of 1, 2, 3, 4 and 5)
- Subword N-gram and Markov chains
- Embeddings in various sizes and dimensions (aligned and unaligned)
- Language Vocabulary
- Language Statistics
![Performance Dashboard](visualizations/performance_dashboard.png)
### Analysis and Evaluation
- [1. Tokenizer Evaluation](#1-tokenizer-evaluation)
- [2. N-gram Model Evaluation](#2-n-gram-model-evaluation)
- [3. Markov Chain Evaluation](#3-markov-chain-evaluation)
- [4. Vocabulary Analysis](#4-vocabulary-analysis)
- [5. Word Embeddings Evaluation](#5-word-embeddings-evaluation)
- [6. Morphological Analysis (Experimental)](#6--morphological-analysis-experimental)
- [7. Summary & Recommendations](#7-summary--recommendations)
- [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide)
- [Visualizations Index](#visualizations-index)
---
## 1. Tokenizer Evaluation
![Tokenizer Compression](visualizations/tokenizer_compression.png)
![Tokenizer Fertility](visualizations/tokenizer_fertility.png)
![Tokenizer OOV](visualizations/tokenizer_oov.png)
![Total Tokens](visualizations/tokenizer_total_tokens.png)
### Results
| Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |
|------------|-------------|---------------|----------|--------------|
| **8k** | 3.481x | 3.48 | 0.1841% | 2,086,930 |
| **16k** | 3.826x | 3.83 | 0.2023% | 1,898,744 |
| **32k** | 4.146x | 4.15 | 0.2192% | 1,752,189 |
| **64k** | 4.413x ๐Ÿ† | 4.41 | 0.2333% | 1,646,367 |
### Tokenization Examples
Below are sample sentences tokenized with each vocabulary size:
**Sample 1:** `Villa Poma estas komunumo de Italio. Kristana patrono estas la ฤ‰efanฤelo Miฤฅaelo...`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–villa โ–p oma โ–estas โ–komunumo โ–de โ–italio . โ–kristana โ–patrono ... (+20 more)` | 30 |
| 16k | `โ–villa โ–p oma โ–estas โ–komunumo โ–de โ–italio . โ–kristana โ–patrono ... (+19 more)` | 29 |
| 32k | `โ–villa โ–p oma โ–estas โ–komunumo โ–de โ–italio . โ–kristana โ–patrono ... (+15 more)` | 25 |
| 64k | `โ–villa โ–p oma โ–estas โ–komunumo โ–de โ–italio . โ–kristana โ–patrono ... (+14 more)` | 24 |
**Sample 2:** `Maroka Esperanto-Asocio estis fondita en kaj aliฤis al IEL en ฤœi malaperis iam p...`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–maro ka โ–esperanto - asocio โ–estis โ–fondita โ–en โ–kaj โ–aliฤis ... (+20 more)` | 30 |
| 16k | `โ–maro ka โ–esperanto - asocio โ–estis โ–fondita โ–en โ–kaj โ–aliฤis ... (+15 more)` | 25 |
| 32k | `โ–maro ka โ–esperanto - asocio โ–estis โ–fondita โ–en โ–kaj โ–aliฤis ... (+15 more)` | 25 |
| 64k | `โ–maroka โ–esperanto - asocio โ–estis โ–fondita โ–en โ–kaj โ–aliฤis โ–al ... (+14 more)` | 24 |
**Sample 3:** `Gรกbor Flรณra Gรกbor Flรณra (sociologo) Gรกbor Flรณra (ฤตurnalisto)`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–gรกbor โ–fl รณ ra โ–gรกbor โ–fl รณ ra โ–( so ... (+12 more)` | 22 |
| 16k | `โ–gรกbor โ–fl รณ ra โ–gรกbor โ–fl รณ ra โ–( so ... (+12 more)` | 22 |
| 32k | `โ–gรกbor โ–fl รณra โ–gรกbor โ–fl รณra โ–( socio logo ) ... (+6 more)` | 16 |
| 64k | `โ–gรกbor โ–flรณra โ–gรกbor โ–flรณra โ–( socio logo ) โ–gรกbor โ–flรณra ... (+3 more)` | 13 |
### Key Findings
- **Best Compression:** 64k achieves 4.413x compression
- **Lowest UNK Rate:** 8k with 0.1841% unknown tokens
- **Trade-off:** Larger vocabularies improve compression but increase model size
- **Recommendation:** 32k vocabulary provides optimal balance for production use
---
## 2. N-gram Model Evaluation
![N-gram Perplexity](visualizations/ngram_perplexity.png)
![N-gram Unique](visualizations/ngram_unique.png)
![N-gram Coverage](visualizations/ngram_coverage.png)
### Results
| N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |
|--------|---------|------------|---------|----------------|------------------|-------------------|
| **2-gram** | Word | 108,491 | 16.73 | 1,486,470 | 12.4% | 25.4% |
| **2-gram** | Subword | 274 ๐Ÿ† | 8.10 | 25,298 | 68.4% | 98.5% |
| **3-gram** | Word | 399,241 | 18.61 | 2,780,390 | 5.0% | 15.3% |
| **3-gram** | Subword | 2,424 | 11.24 | 190,200 | 27.0% | 70.9% |
| **4-gram** | Word | 881,572 | 19.75 | 4,990,877 | 4.2% | 12.2% |
| **4-gram** | Subword | 14,832 | 13.86 | 1,096,577 | 13.7% | 38.9% |
| **5-gram** | Word | 691,548 | 19.40 | 3,754,069 | 4.8% | 12.9% |
| **5-gram** | Subword | 64,228 | 15.97 | 3,655,538 | 8.6% | 24.7% |
### Top 5 N-grams by Size
**2-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `de la` | 1,492,381 |
| 2 | `en la` | 835,570 |
| 3 | `al la` | 249,845 |
| 4 | `a de` | 192,000 |
| 5 | `eksteraj ligiloj` | 181,742 |
**3-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `eksteraj ligiloj de` | 52,302 |
| 2 | `en la jaro` | 44,831 |
| 3 | `unu el la` | 40,188 |
| 4 | `parto de la` | 38,090 |
| 5 | `de la ฤ‰efa` | 35,329 |
**4-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `eksteraj ligiloj de la` | 28,651 |
| 2 | `de la ฤ‰efa zono` | 27,354 |
| 3 | `ligiloj de la ฤ‰efa` | 26,688 |
| 4 | `la ฤ‰efa zono de` | 24,148 |
| 5 | `en la komunumo vivis` | 23,236 |
**5-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `eksteraj ligiloj de la ฤ‰efa` | 26,688 |
| 2 | `ligiloj de la ฤ‰efa zono` | 26,688 |
| 3 | `de la ฤ‰efa zono de` | 24,143 |
| 4 | `rezultigas loฤdenson de loฤantoj km` | 20,132 |
| 5 | `kio rezultigas loฤdenson de loฤantoj` | 19,700 |
**2-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `a _` | 13,964,697 |
| 2 | `o _` | 11,295,005 |
| 3 | `_ l` | 9,649,552 |
| 4 | `l a` | 9,580,010 |
| 5 | `e _` | 9,155,935 |
**3-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `_ l a` | 6,963,790 |
| 2 | `l a _` | 6,963,398 |
| 3 | `_ d e` | 5,680,067 |
| 4 | `d e _` | 5,242,334 |
| 5 | `a j _` | 4,347,785 |
**4-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `_ l a _` | 6,305,355 |
| 2 | `_ d e _` | 4,963,545 |
| 3 | `_ e n _` | 2,738,460 |
| 4 | `o _ d e` | 2,615,035 |
| 5 | `k a j _` | 2,246,847 |
**5-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `o _ d e _` | 2,540,310 |
| 2 | `_ k a j _` | 2,096,530 |
| 3 | `e _ l a _` | 1,846,408 |
| 4 | `_ d e _ l` | 1,672,713 |
| 5 | `d e _ l a` | 1,585,833 |
### Key Findings
- **Best Perplexity:** 2-gram (subword) with 274
- **Entropy Trend:** Decreases with larger n-grams (more predictable)
- **Coverage:** Top-1000 patterns cover ~25% of corpus
- **Recommendation:** 4-gram or 5-gram for best predictive performance
---
## 3. Markov Chain Evaluation
![Markov Entropy](visualizations/markov_entropy.png)
![Markov Contexts](visualizations/markov_contexts.png)
![Markov Branching](visualizations/markov_branching.png)
### Results
| Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |
|---------|---------|-------------|------------|------------------|-----------------|----------------|
| **1** | Word | 0.9337 | 1.910 | 9.47 | 2,204,272 | 6.6% |
| **1** | Subword | 0.7752 | 1.711 | 6.07 | 20,402 | 22.5% |
| **2** | Word | 0.3324 | 1.259 | 2.16 | 20,817,803 | 66.8% |
| **2** | Subword | 0.5829 | 1.498 | 4.00 | 123,791 | 41.7% |
| **3** | Word | 0.1405 | 1.102 | 1.34 | 44,924,875 | 86.0% |
| **3** | Subword | 0.6753 | 1.597 | 3.97 | 494,617 | 32.5% |
| **4** | Word | 0.0607 ๐Ÿ† | 1.043 | 1.12 | 59,947,880 | 93.9% |
| **4** | Subword | 0.6688 | 1.590 | 3.43 | 1,962,883 | 33.1% |
### Generated Text Samples (Word-based)
Below are text samples generated from each word-based Markov chain model:
**Context Size 1:**
1. `la litiaj saloj kaj en ฤ‰eฤฅio protektata de la unua ฤ‰efministro de calisto y aycinena en`
2. `de pierre leroux michel ludanto disponas pri sociologio matematiko scienco parencas al la organizo e...`
3. `en szalacs tauberbischofsheim estas maksimume verลajne dum la barilo sed en la genro de septembro ja...`
**Context Size 2:**
1. `de la prezidanto de senegala esperanto asocio kunorganizantino de ais prilaborinto de katalogo havas...`
2. `en la somero en la nova gvidanto de rusa imperio ฤis la 22 an de oktobro 21`
3. `al la kunlaborantaro por gajni la ฤตurian premion tie pro tio oni enkondukis devizon dio honoro kaj`
**Context Size 3:**
1. `eksteraj ligiloj de la ฤ‰efa zono de toshimasa furuta de masayuki iwamoto objektoj malkovritaj en de ...`
2. `en la jaro la municipo estis signifa centro de kavalira ordeno de la templanoj malmulton oni aลญdis p...`
3. `unu el la 6 arondismentoj de la departemento ain kaj en la historia loko apartenas al la arondisment...`
**Context Size 4:**
1. `eksteraj ligiloj de la ฤ‰efa zono objektoj malkovritaj en de neat`
2. `de la ฤ‰efa zono de scap objektoj malkovritaj en`
3. `ligiloj de la ฤ‰efa zono objektoj malkovritaj en de udas`
### Generated Text Samples (Subword-based)
Below are text samples generated from each subword-based Markov chain model:
**Context Size 1:**
1. `_j,_46)_dua_kuto`
2. `amastigildej_mon`
3. `o_spo._(in_okajo`
**Context Size 2:**
1. `a_ro_koridustalo,`
2. `o_detlekstro_kali`
3. `_la_tra_illeudojn`
**Context Size 3:**
1. `_la_reฤlanda._prok`
2. `la_vers_rado_de_ba`
3. `_de_inter_oni,_?)_`
**Context Size 4:**
1. `_la_4-a_(negoco_dum`
2. `_de_vundo_(ลafoj_es`
3. `_en_ฤia_lingvoj)_du`
### Key Findings
- **Best Predictability:** Context-4 (word) with 93.9% predictability
- **Branching Factor:** Decreases with context size (more deterministic)
- **Memory Trade-off:** Larger contexts require more storage (1,962,883 contexts)
- **Recommendation:** Context-3 or Context-4 for text generation
---
## 4. Vocabulary Analysis
![Zipf's Law](visualizations/zipf_law.png)
![Top Words](visualizations/top20_words.png)
![Coverage Curve](visualizations/vocab_coverage.png)
### Statistics
| Metric | Value |
|--------|-------|
| Vocabulary Size | 1,016,865 |
| Total Tokens | 83,733,530 |
| Mean Frequency | 82.34 |
| Median Frequency | 4 |
| Frequency Std Dev | 9100.50 |
### Most Common Words
| Rank | Word | Frequency |
|------|------|-----------|
| 1 | la | 6,422,072 |
| 2 | de | 4,999,008 |
| 3 | en | 2,827,390 |
| 4 | kaj | 2,109,899 |
| 5 | estas | 1,116,028 |
| 6 | al | 714,533 |
| 7 | estis | 691,295 |
| 8 | li | 537,455 |
| 9 | a | 535,639 |
| 10 | kun | 415,467 |
### Least Common Words (from vocabulary)
| Rank | Word | Frequency |
|------|------|-----------|
| 1 | uruguaii | 2 |
| 2 | surutus | 2 |
| 3 | haringosta | 2 |
| 4 | hasbroucki | 2 |
| 5 | intuitionist | 2 |
| 6 | vanrevels | 2 |
| 7 | jashber | 2 |
| 8 | gerudoj | 2 |
| 9 | darunia | 2 |
| 10 | zoraoj | 2 |
### Zipf's Law Analysis
| Metric | Value |
|--------|-------|
| Zipf Coefficient | 1.0052 |
| Rยฒ (Goodness of Fit) | 0.998112 |
| Adherence Quality | **excellent** |
### Coverage Analysis
| Top N Words | Coverage |
|-------------|----------|
| Top 100 | 38.5% |
| Top 1,000 | 58.1% |
| Top 5,000 | 72.4% |
| Top 10,000 | 78.2% |
### Key Findings
- **Zipf Compliance:** Rยฒ=0.9981 indicates excellent adherence to Zipf's law
- **High Frequency Dominance:** Top 100 words cover 38.5% of corpus
- **Long Tail:** 1,006,865 words needed for remaining 21.8% coverage
---
## 5. Word Embeddings Evaluation
![Embedding Isotropy](visualizations/embedding_isotropy.png)
![Similarity Matrix](visualizations/embedding_similarity.png)
![t-SNE Words](visualizations/tsne_words.png)
![t-SNE Sentences](visualizations/tsne_sentences.png)
### 5.1 Cross-Lingual Alignment
![Alignment Quality](visualizations/embedding_alignment_quality.png)
![Multilingual t-SNE](visualizations/embedding_tsne_multilingual.png)
### 5.2 Model Comparison
| Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
|-------|-----------|----------|------------------|---------------|----------------|
| **mono_32d** | 32 | 0.7822 | 0.3552 | N/A | N/A |
| **mono_64d** | 64 | 0.7669 | 0.2911 | N/A | N/A |
| **mono_128d** | 128 | 0.7038 | 0.2271 | N/A | N/A |
| **aligned_32d** | 32 | 0.7822 ๐Ÿ† | 0.3657 | 0.3140 | 0.7080 |
| **aligned_64d** | 64 | 0.7669 | 0.2870 | 0.5680 | 0.9060 |
| **aligned_128d** | 128 | 0.7038 | 0.2283 | 0.6240 | 0.9180 |
### Key Findings
- **Best Isotropy:** aligned_32d with 0.7822 (more uniform distribution)
- **Semantic Density:** Average pairwise similarity of 0.2924. Lower values indicate better semantic separation.
- **Alignment Quality:** Aligned models achieve up to 62.4% R@1 in cross-lingual retrieval.
- **Recommendation:** 128d aligned for best cross-lingual performance
---
## 6. Morphological Analysis (Experimental)
This section presents an automated morphological analysis derived from the statistical divergence between word-level and subword-level models. By analyzing where subword predictability spikes and where word-level coverage fails, we can infer linguistic structures without supervised data.
### 6.1 Productivity & Complexity
| Metric | Value | Interpretation | Recommendation |
|--------|-------|----------------|----------------|
| Productivity Index | **5.000** | High morphological productivity | Reliable analysis |
| Idiomaticity Gap | **-0.476** | Low formulaic content | - |
### 6.2 Affix Inventory (Productive Units)
These are the most productive prefixes and suffixes identified by sampling the vocabulary for global substitutability patterns. A unit is considered an affix if stripping it leaves a valid stem that appears in other contexts.
#### Productive Prefixes
| Prefix | Examples |
|--------|----------|
| `-s` | samoรซns, satirischer, statline |
| `-a` | araลญkanoj, antisemiten, animigo |
| `-k` | kรผrenberger, kinnor, krimaฤตojn |
| `-t` | thees, terke, tunelportalo |
| `-b` | bil, bรผrgstadt, broadacre |
| `-r` | retopezzoli, ridolfi, resumo |
| `-e` | elsendejo, espedita, eb26 |
| `-ma` | mafai, malfari, mamminger |
#### Productive Suffixes
| Suffix | Examples |
|--------|----------|
| `-o` | ลovbloko, resumo, orsoลญko |
| `-n` | antisemiten, pinajn, hontaรฑรณn |
| `-a` | fakoaplikata, deobrigula, mehadica |
| `-j` | araลญkanoj, stokistoj, nikoj |
| `-oj` | araลญkanoj, stokistoj, nikoj |
| `-s` | samoรซns, thees, valognes |
| `-e` | depestre, terke, statline |
| `-on` | arnaldon, jetaฤตon, maturecdiplomon |
### 6.3 Bound Stems (Lexical Roots)
Bound stems are high-frequency subword units that are semantically cohesive but rarely appear as standalone words. These often correspond to the 'core' of a word that requires inflection or derivation to be valid.
| Stem | Cohesion | Substitutability | Examples |
|------|----------|------------------|----------|
| `onst` | 2.38x | 125 contexts | fonst, sonst, konst |
| `rman` | 1.64x | 563 contexts | erman, arman, orman |
| `igil` | 2.08x | 138 contexts | rigil, digil, vigil |
| `tojn` | 1.88x | 233 contexts | atojn, batojn, aลญtojn |
| `stru` | 1.76x | 336 contexts | strum, estru, strub |
| `olog` | 1.57x | 601 contexts | molog, lolog, dolog |
| `igit` | 1.53x | 543 contexts | digit, igita, yigit |
| `ngar` | 1.72x | 240 contexts | ungar, ongar, angar |
| `nstr` | 1.84x | 144 contexts | instr, instru, zanstra |
| `ontr` | 1.69x | 203 contexts | montr, contr, kontr |
| `nter` | 1.45x | 401 contexts | inter, onter, unter |
| `munu` | 2.57x | 26 contexts | munus, munuo, munuza |
### 6.4 Affix Compatibility (Co-occurrence)
This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
| Prefix | Suffix | Frequency | Examples |
|--------|--------|-----------|----------|
| `-k` | `-o` | 110 words | kornalaลญdo, kontraลญreligieco |
| `-s` | `-o` | 110 words | schwartzenbergministro, sarsano |
| `-s` | `-n` | 110 words | sinesprimon, sulston |
| `-p` | `-o` | 107 words | pdfdecreto, palmoturdo |
| `-k` | `-n` | 97 words | kandidatinon, kulturspacon |
| `-p` | `-n` | 95 words | prognozon, plejbonecon |
| `-s` | `-j` | 94 words | soloistaj, superheroaj |
| `-a` | `-o` | 90 words | aneksiigo, altkulturo |
| `-p` | `-j` | 88 words | prifosadoj, planedaroj |
| `-k` | `-a` | 88 words | katarฤตena, kartuna |
### 6.5 Recursive Morpheme Segmentation
Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).
| Word | Suggested Split | Confidence | Stem |
|------|-----------------|------------|------|
| carrascalejanos | **`carrascalejan-o-s`** | 7.5 | `o` |
| hernalser | **`hernal-s-er`** | 7.5 | `s` |
| stockoceros | **`stockocer-o-s`** | 7.5 | `o` |
| philogelos | **`philogel-o-s`** | 7.5 | `o` |
| mandirola | **`mandi-ro-la`** | 7.5 | `ro` |
| infoescola | **`infoesc-o-la`** | 7.5 | `o` |
| evititajn | **`eviti-ta-jn`** | 7.5 | `ta` |
| portolano | **`porto-la-no`** | 7.5 | `la` |
| waltershรคuser | **`waltershรคu-s-er`** | 7.5 | `s` |
| rostrenen | **`rostre-n-en`** | 7.5 | `n` |
| goldapfel | **`goldapf-e-l`** | 7.5 | `e` |
| pintakrajn | **`pintak-ra-jn`** | 7.5 | `ra` |
| herencsรฉny | **`herencsรฉ-n-y`** | 7.5 | `n` |
| respondos | **`respond-o-s`** | 7.5 | `o` |
| interลanฤataj | **`interลanฤa-ta-j`** | 7.5 | `ta` |
### 6.6 Linguistic Interpretation
> **Automated Insight:**
The language Esperanto shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
---
## 7. Summary & Recommendations
![Performance Dashboard](visualizations/performance_dashboard.png)
### Production Recommendations
| Component | Recommended | Rationale |
|-----------|-------------|-----------|
| Tokenizer | **64k BPE** | Best compression (4.41x) |
| N-gram | **2-gram** | Lowest perplexity (274) |
| Markov | **Context-4** | Highest predictability (93.9%) |
| Embeddings | **100d** | Balanced semantic capture and isotropy |
---
## Appendix: Metrics Glossary & Interpretation Guide
This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
### Tokenizer Metrics
**Compression Ratio**
> *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
>
> *Intuition:* Higher compression means fewer tokens needed to represent the same text, reducing sequence lengths for downstream models. A 3x compression means ~3 characters per token on average.
>
> *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
**Average Token Length (Fertility)**
> *Definition:* Mean number of characters per token produced by the tokenizer.
>
> *Intuition:* Reflects the granularity of tokenization. Longer tokens capture more context but may struggle with rare words; shorter tokens are more flexible but increase sequence length.
>
> *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
**Unknown Token Rate (OOV Rate)**
> *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
>
> *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
>
> *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
### N-gram Model Metrics
**Perplexity**
> *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
>
> *Intuition:* If perplexity is 100, the model is as uncertain as if choosing uniformly among 100 options at each step. A perplexity of 10 means effectively choosing among 10 equally likely options.
>
> *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
**Entropy**
> *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
>
> *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
>
> *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
**Coverage (Top-K)**
> *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.
>
> *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
>
> *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
### Markov Chain Metrics
**Average Entropy**
> *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
>
> *Intuition:* Lower entropy means the model is more confident about what comes next. Context-1 has high entropy (many possible next words); Context-4 has low entropy (few likely continuations).
>
> *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
**Branching Factor**
> *Definition:* Average number of unique next tokens observed for each context.
>
> *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
>
> *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
**Predictability**
> *Definition:* Derived metric: (1 - normalized_entropy) ร— 100%. Indicates how deterministic the model's predictions are.
>
> *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
>
> *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
### Vocabulary & Zipf's Law Metrics
**Zipf's Coefficient**
> *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
>
> *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
>
> *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
**Rยฒ (Coefficient of Determination)**
> *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
>
> *Intuition:* Rยฒ near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
>
> *What to seek:* Rยฒ > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
**Vocabulary Coverage**
> *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.
>
> *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
>
> *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
### Word Embedding Metrics
**Isotropy**
> *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
>
> *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
>
> *What to seek:* Higher isotropy generally indicates better-quality embeddings. Values > 0.1 are reasonable; > 0.3 is good. Lower-dimensional embeddings tend to have higher isotropy.
**Average Norm**
> *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.
>
> *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
>
> *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
**Cosine Similarity**
> *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
>
> *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
>
> *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
**t-SNE Visualization**
> *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
>
> *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
>
> *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
### General Interpretation Guidelines
1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
5. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
### Visualizations Index
| Visualization | Description |
|---------------|-------------|
| Tokenizer Compression | Compression ratios by vocabulary size |
| Tokenizer Fertility | Average token length by vocabulary |
| Tokenizer OOV | Unknown token rates |
| Tokenizer Total Tokens | Total tokens by vocabulary |
| N-gram Perplexity | Perplexity by n-gram size |
| N-gram Entropy | Entropy by n-gram size |
| N-gram Coverage | Top pattern coverage |
| N-gram Unique | Unique n-gram counts |
| Markov Entropy | Entropy by context size |
| Markov Branching | Branching factor by context |
| Markov Contexts | Unique context counts |
| Zipf's Law | Frequency-rank distribution with fit |
| Vocab Frequency | Word frequency distribution |
| Top 20 Words | Most frequent words |
| Vocab Coverage | Cumulative coverage curve |
| Embedding Isotropy | Vector space uniformity |
| Embedding Norms | Vector magnitude distribution |
| Embedding Similarity | Word similarity heatmap |
| Nearest Neighbors | Similar words for key terms |
| t-SNE Words | 2D word embedding visualization |
| t-SNE Sentences | 2D sentence embedding visualization |
| Position Encoding | Encoding method comparison |
| Model Sizes | Storage requirements |
| Performance Dashboard | Comprehensive performance overview |
---
## About This Project
### Data Source
Models trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - a monthly snapshot of Wikipedia articles across 300+ languages.
### Project
A project by **[Wikilangs](https://wikilangs.org)** - Open-source NLP models for every Wikipedia language.
### Maintainer
[Omar Kamali](https://omarkamali.com) - [Omneity Labs](https://omneitylabs.com)
### Citation
If you use these models in your research, please cite:
```bibtex
@misc{wikilangs2025,
author = {Kamali, Omar},
title = {Wikilangs: Open NLP Models for Wikipedia Languages},
year = {2025},
doi = {10.5281/zenodo.18073153},
publisher = {Zenodo},
url = {https://huggingface.co/wikilangs}
institution = {Omneity Labs}
}
```
### License
MIT License - Free for academic and commercial use.
### Links
- ๐ŸŒ Website: [wikilangs.org](https://wikilangs.org)
- ๐Ÿค— Models: [huggingface.co/wikilangs](https://huggingface.co/wikilangs)
- ๐Ÿ“Š Data: [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)
- ๐Ÿ‘ค Author: [Omar Kamali](https://huggingface.co/omarkamali)
- ๐Ÿค Sponsor: [Featherless AI](https://featherless.ai)
---
*Generated by Wikilangs Models Pipeline*
*Report Date: 2026-01-12 01:25:57*