CoolFace
Modelpublic

wikilangs/dtp

sourceHugging Facemitupdated 9mo agoView on Hugging Face
1likes
README.md767 linesDownload Raw Back to root
1---2language: dtp3language_name: Central Dusun4language_family: austronesian_other5tags:6  - wikilangs7  - nlp8  - tokenizer9  - embeddings10  - n-gram11  - markov12  - wikipedia13  - feature-extraction14  - sentence-similarity15  - tokenization16  - n-grams17  - markov-chain18  - text-mining19  - fasttext20  - babelvec21  - vocabulous22  - vocabulary23  - monolingual24  - family-austronesian_other25license: mit26library_name: wikilangs27pipeline_tag: text-generation28datasets:29  - omarkamali/wikipedia-monthly30dataset_info:31  name: wikipedia-monthly32  description: Monthly snapshots of Wikipedia articles across 300+ languages33metrics:34  - name: best_compression_ratio35    type: compression36    value: 4.96237  - name: best_isotropy38    type: isotropy39    value: 0.867940  - name: vocabulary_size41    type: vocab42    value: 043generated: 2026-01-0444---45 46# Central Dusun - Wikilangs Models47## Comprehensive Research Report & Full Ablation Study48 49This repository contains NLP models trained and evaluated by Wikilangs, specifically on **Central Dusun** Wikipedia data.50We analyze tokenizers, n-gram models, Markov chains, vocabulary statistics, and word embeddings.51 52## 📋 Repository Contents53 54### Models & Assets55 56- Tokenizers (8k, 16k, 32k, 64k)57- N-gram models (2, 3, 4, 5-gram)58- Markov chains (context of 1, 2, 3, 4 and 5)59- Subword N-gram and Markov chains60- Embeddings in various sizes and dimensions (aligned and unaligned)61- Language Vocabulary62- Language Statistics63 64![Performance Dashboard](visualizations/performance_dashboard.png)65 66### Analysis and Evaluation67 68- [1. Tokenizer Evaluation](#1-tokenizer-evaluation)69- [2. N-gram Model Evaluation](#2-n-gram-model-evaluation)70- [3. Markov Chain Evaluation](#3-markov-chain-evaluation)71- [4. Vocabulary Analysis](#4-vocabulary-analysis)72- [5. Word Embeddings Evaluation](#5-word-embeddings-evaluation)73- [6. Morphological Analysis (Experimental)](#6--morphological-analysis-experimental)74- [7. Summary & Recommendations](#7-summary--recommendations)75- [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide)76- [Visualizations Index](#visualizations-index)77 78---79## 1. Tokenizer Evaluation80 81![Tokenizer Compression](visualizations/tokenizer_compression.png)82 83![Tokenizer Fertility](visualizations/tokenizer_fertility.png)84 85![Tokenizer OOV](visualizations/tokenizer_oov.png)86 87![Total Tokens](visualizations/tokenizer_total_tokens.png)88 89### Results90 91| Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |92|------------|-------------|---------------|----------|--------------|93| **8k** | 4.024x | 4.03 | 0.1643% | 595,784 |94| **16k** | 4.420x | 4.42 | 0.1805% | 542,287 |95| **32k** | 4.736x | 4.74 | 0.1934% | 506,176 |96| **64k** | 4.962x 🏆 | 4.96 | 0.2026% | 483,109 |97 98### Tokenization Examples99 100Below are sample sentences tokenized with each vocabulary size:101 102**Sample 1:** `Boros Murut Timugon nopo nga boros di gunoon do Tulun Murut id Borneo. Sukuon`103 104| Vocab | Tokens | Count |105|-------|--------|-------|106| 8k | `▁boros ▁murut ▁tim ug on ▁nopo ▁nga ▁boros ▁di ▁gunoon ... (+7 more)` | 17 |107| 16k | `▁boros ▁murut ▁tim ug on ▁nopo ▁nga ▁boros ▁di ▁gunoon ... (+7 more)` | 17 |108| 32k | `▁boros ▁murut ▁tim ugon ▁nopo ▁nga ▁boros ▁di ▁gunoon ▁do ... (+6 more)` | 16 |109| 64k | `▁boros ▁murut ▁timugon ▁nopo ▁nga ▁boros ▁di ▁gunoon ▁do ▁tulun ... (+5 more)` | 15 |110 111**Sample 2:** `Suminundu nopo nga sinawaan di Kinoingan.Kitanak yolo do songulun tondu tolumis ...`112 113| Vocab | Tokens | Count |114|-------|--------|-------|115| 8k | `▁sumin undu ▁nopo ▁nga ▁sin awaan ▁di ▁kino ingan . ... (+14 more)` | 24 |116| 16k | `▁sumin undu ▁nopo ▁nga ▁sinawaan ▁di ▁kinoingan . k itanak ... (+11 more)` | 21 |117| 32k | `▁sumin undu ▁nopo ▁nga ▁sinawaan ▁di ▁kinoingan . k itanak ... (+10 more)` | 20 |118| 64k | `▁suminundu ▁nopo ▁nga ▁sinawaan ▁di ▁kinoingan . kitanak ▁yolo ▁do ... (+8 more)` | 18 |119 120**Sample 3:** `Mongintob nopo nga nunu nopo iri kokomoi do ginumu, ginayo, sinodu toi winagat.`121 122| Vocab | Tokens | Count |123|-------|--------|-------|124| 8k | `▁mongin tob ▁nopo ▁nga ▁nunu ▁nopo ▁iri ▁kokomoi ▁do ▁ginumu ... (+7 more)` | 17 |125| 16k | `▁mongintob ▁nopo ▁nga ▁nunu ▁nopo ▁iri ▁kokomoi ▁do ▁ginumu , ... (+6 more)` | 16 |126| 32k | `▁mongintob ▁nopo ▁nga ▁nunu ▁nopo ▁iri ▁kokomoi ▁do ▁ginumu , ... (+6 more)` | 16 |127| 64k | `▁mongintob ▁nopo ▁nga ▁nunu ▁nopo ▁iri ▁kokomoi ▁do ▁ginumu , ... (+6 more)` | 16 |128 129 130### Key Findings131 132- **Best Compression:** 64k achieves 4.962x compression133- **Lowest UNK Rate:** 8k with 0.1643% unknown tokens134- **Trade-off:** Larger vocabularies improve compression but increase model size135- **Recommendation:** 32k vocabulary provides optimal balance for production use136 137---138## 2. N-gram Model Evaluation139 140![N-gram Perplexity](visualizations/ngram_perplexity.png)141 142![N-gram Unique](visualizations/ngram_unique.png)143 144![N-gram Coverage](visualizations/ngram_coverage.png)145 146### Results147 148| N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |149|--------|---------|------------|---------|----------------|------------------|-------------------|150| **2-gram** | Word | 7,224 | 12.82 | 18,432 | 17.6% | 40.2% |151| **2-gram** | Subword | 227 🏆 | 7.82 | 2,665 | 72.6% | 99.5% |152| **3-gram** | Word | 10,598 | 13.37 | 17,860 | 12.0% | 30.6% |153| **3-gram** | Subword | 1,902 | 10.89 | 18,913 | 28.7% | 75.5% |154| **4-gram** | Word | 17,687 | 14.11 | 21,653 | 5.2% | 18.7% |155| **4-gram** | Subword | 10,332 | 13.33 | 90,801 | 14.5% | 42.9% |156| **5-gram** | Word | 9,233 | 13.17 | 10,312 | 5.0% | 23.1% |157| **5-gram** | Subword | 32,680 | 15.00 | 217,159 | 9.9% | 28.5% |158 159### Top 5 N-grams by Size160 161**2-grams (Word):**162 163| Rank | N-gram | Count |164|------|--------|-------|165| 1 | `nopo nga` | 11,657 |166| 2 | `id suang` | 2,821 |167| 3 | `toi ko` | 1,861 |168| 4 | `ontok toun` | 1,828 |169| 5 | `nga iso` | 1,049 |170 171**3-grams (Word):**172 173| Rank | N-gram | Count |174|------|--------|-------|175| 1 | `nopo nga iso` | 951 |176| 2 | `diti nopo nga` | 935 |177| 3 | `id suang do` | 660 |178| 4 | `nopo nga songulun` | 600 |179| 5 | `nopo diti nga` | 439 |180 181**4-grams (Word):**182 183| Rank | N-gram | Count |184|------|--------|-------|185| 1 | `nopo nga iso mantad` | 117 |186| 2 | `nopo nga iso kawo` | 79 |187| 3 | `nopo nga songulun mimingkono` | 75 |188| 4 | `nopo nga kohompit no` | 71 |189| 5 | `nopo nga iso pogun` | 70 |190 191**5-grams (Word):**192 193| Rank | N-gram | Count |194|------|--------|-------|195| 1 | `archived from the original on` | 42 |196| 2 | `toi ko lobi ointutunan sabaagi` | 34 |197| 3 | `koposion pogulu om pondidikan nosusu` | 25 |198| 4 | `toun uhu kono saluran tv` | 24 |199| 5 | `mw parser output reflist lower` | 24 |200 201**2-grams (Subword):**202 203| Rank | N-gram | Count |204|------|--------|-------|205| 1 | `a n` | 132,420 |206| 2 | `n _` | 100,917 |207| 3 | `o _` | 92,031 |208| 4 | `i _` | 88,621 |209| 5 | `o n` | 79,747 |210 211**3-grams (Subword):**212 213| Rank | N-gram | Count |214|------|--------|-------|215| 1 | `a n _` | 56,169 |216| 2 | `d o _` | 34,236 |217| 3 | `_ n o` | 33,345 |218| 4 | `_ d o` | 32,858 |219| 5 | `_ k o` | 28,766 |220 221**4-grams (Subword):**222 223| Rank | N-gram | Count |224|------|--------|-------|225| 1 | `_ d o _` | 30,800 |226| 2 | `_ i d _` | 22,452 |227| 3 | `_ o m _` | 19,951 |228| 4 | `_ n g a` | 17,310 |229| 5 | `n o p o` | 15,354 |230 231**5-grams (Subword):**232 233| Rank | N-gram | Count |234|------|--------|-------|235| 1 | `_ n g a _` | 14,567 |236| 2 | `_ n o p o` | 14,303 |237| 3 | `n o p o _` | 14,096 |238| 4 | `o n t o k` | 12,540 |239| 5 | `n t o k _` | 12,488 |240 241 242### Key Findings243 244- **Best Perplexity:** 2-gram (subword) with 227245- **Entropy Trend:** Decreases with larger n-grams (more predictable)246- **Coverage:** Top-1000 patterns cover ~29% of corpus247- **Recommendation:** 4-gram or 5-gram for best predictive performance248 249---250## 3. Markov Chain Evaluation251 252![Markov Entropy](visualizations/markov_entropy.png)253 254![Markov Contexts](visualizations/markov_contexts.png)255 256![Markov Branching](visualizations/markov_branching.png)257 258### Results259 260| Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |261|---------|---------|-------------|------------|------------------|-----------------|----------------|262| **1** | Word | 0.8540 | 1.808 | 5.51 | 70,711 | 14.6% |263| **1** | Subword | 0.8991 | 1.865 | 5.16 | 1,986 | 10.1% |264| **2** | Word | 0.2712 | 1.207 | 1.62 | 388,589 | 72.9% |265| **2** | Subword | 0.6820 | 1.604 | 4.13 | 10,241 | 31.8% |266| **3** | Word | 0.0811 | 1.058 | 1.13 | 628,158 | 91.9% |267| **3** | Subword | 0.7746 | 1.711 | 3.85 | 42,293 | 22.5% |268| **4** | Word | 0.0237 🏆 | 1.017 | 1.03 | 709,279 | 97.6% |269| **4** | Subword | 0.6516 | 1.571 | 2.76 | 162,763 | 34.8% |270 271### Generated Text Samples (Word-based)272 273Below are text samples generated from each word-based Markov chain model:274 275**Context Size 1:**276 2771. `do tasu piipiro posis nopo nga bagas menteri malaysia toi ko 7 3w 7 808 güzelbahçe`2782. `id boros sweden maamaso timpu pogulu nosusu i nopo nga okito nogi i rajaa do amu`2793. `om papaharo sikul takawas id keningau diti nga kohompit om gisom pinoposiliu do dudumagang maritim m...`280 281**Context Size 2:**282 2831. `nopo nga okito id posorili do kuil kuil bongunan bongunan winonsoi o kinoyonon diti galeri sukuon pa...`2842. `id suang pambalajalan loolobi id gana do sains sosial om ekonomi mogigion do pulau bali winonsoi o`2853. `toi ko bandar raya santiago gurun atacama ii gersang id utara chile nopo nga kosoruan ointutunan sab...`286 287**Context Size 3:**288 2891. `nopo nga iso kakadayan komponen kalas ko 5 id kointayadan do 50 tondu yahudi di bobos boroson id`2902. `diti nopo nga kiwaa totos okuri nopo nga kirati do tudan udan talasu om i bobos poinwagu nopo`2913. `id suang do watas tenom om id siriba kotoinaan do upis watas keningau di laid abaabayan dii nopo`292 293**Context Size 4:**294 2951. `nopo nga iso mantad tolu puruan tinimungan slav kosilahon ii kakal po do pharo ii suai nopo nga monu...`2962. `nopo nga iso kawo boros dayak i popohompit do duo dialek daro om matu dialek mantad boros austronesi...`2973. `nopo nga songulun mimingkono di abantung kopio maya piipiro film miagal ko x men apocalypse om nogi ...`298 299 300### Generated Text Samples (Subword-based)301 302Below are text samples generated from each subword-based Markov chain model:303 304**Context Size 1:**305 3061. `_2_,_suhyl_palal`3072. `aheacasomomoid_p`3083. `ombaaiayosiesili`309 310**Context Size 2:**311 3121. `an_gan_ka_kopoko_`3132. `n_mek_koudions_gr`3143. `o_dukul_bihaguluh`315 316**Context Size 3:**317 3181. `an_abaagu_di_aut"_`3192. `do_sukuon_debutang`3203. `_nokobol_kopo_ngam`321 322**Context Size 4:**323 3241. `_do_ponuan_chillage`3252. `_id_sabaagi_gisom_n`3263. `_om_institud_5.11-3`327 328 329### Key Findings330 331- **Best Predictability:** Context-4 (word) with 97.6% predictability332- **Branching Factor:** Decreases with context size (more deterministic)333- **Memory Trade-off:** Larger contexts require more storage (162,763 contexts)334- **Recommendation:** Context-3 or Context-4 for text generation335 336---337## 4. Vocabulary Analysis338 339![Zipf's Law](visualizations/zipf_law.png)340 341![Top Words](visualizations/top20_words.png)342 343![Coverage Curve](visualizations/vocab_coverage.png)344 345### Statistics346 347| Metric | Value |348|--------|-------|349| Vocabulary Size | 30,571 |350| Total Tokens | 714,971 |351| Mean Frequency | 23.39 |352| Median Frequency | 4 |353| Frequency Std Dev | 322.81 |354 355### Most Common Words356 357| Rank | Word | Frequency |358|------|------|-----------|359| 1 | do | 30,939 |360| 2 | id | 22,604 |361| 3 | om | 20,001 |362| 4 | nga | 15,882 |363| 5 | nopo | 14,210 |364| 6 | di | 13,677 |365| 7 | i | 9,637 |366| 8 | mantad | 7,460 |367| 9 | ontok | 6,784 |368| 10 | sabaagi | 5,793 |369 370### Least Common Words (from vocabulary)371 372| Rank | Word | Frequency |373|------|------|-----------|374| 1 | nın | 2 |375| 2 | tarihçesi | 2 |376| 3 | paü | 2 |377| 4 | eğitim | 2 |378| 5 | dergisi | 2 |379| 6 | sayı | 2 |380| 7 | mongumang | 2 |381| 8 | mikattiwang | 2 |382| 9 | sisimbarpulou | 2 |383| 10 | koz | 2 |384 385### Zipf's Law Analysis386 387| Metric | Value |388|--------|-------|389| Zipf Coefficient | 1.0496 |390| R² (Goodness of Fit) | 0.994075 |391| Adherence Quality | **excellent** |392 393### Coverage Analysis394 395| Top N Words | Coverage |396|-------------|----------|397| Top 100 | 41.6% |398| Top 1,000 | 66.1% |399| Top 5,000 | 84.5% |400| Top 10,000 | 91.2% |401 402### Key Findings403 404- **Zipf Compliance:** R²=0.9941 indicates excellent adherence to Zipf's law405- **High Frequency Dominance:** Top 100 words cover 41.6% of corpus406- **Long Tail:** 20,571 words needed for remaining 8.8% coverage407 408---409## 5. Word Embeddings Evaluation410 411![Embedding Isotropy](visualizations/embedding_isotropy.png)412 413![Similarity Matrix](visualizations/embedding_similarity.png)414 415![t-SNE Words](visualizations/tsne_words.png)416 417![t-SNE Sentences](visualizations/tsne_sentences.png)418 419 420### 5.1 Cross-Lingual Alignment421 422![Alignment Quality](visualizations/embedding_alignment_quality.png)423 424![Multilingual t-SNE](visualizations/embedding_tsne_multilingual.png)425 426 427### 5.2 Model Comparison428 429| Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |430|-------|-----------|----------|------------------|---------------|----------------|431| **mono_32d** | 32 | 0.8679 🏆 | 0.3272 | N/A | N/A |432| **mono_64d** | 64 | 0.7620 | 0.2632 | N/A | N/A |433| **mono_128d** | 128 | 0.3462 | 0.2417 | N/A | N/A |434| **aligned_32d** | 32 | 0.8679 | 0.3226 | 0.0560 | 0.2820 |435| **aligned_64d** | 64 | 0.7620 | 0.2720 | 0.1060 | 0.3860 |436| **aligned_128d** | 128 | 0.3462 | 0.2427 | 0.2020 | 0.5260 |437 438### Key Findings439 440- **Best Isotropy:** mono_32d with 0.8679 (more uniform distribution)441- **Semantic Density:** Average pairwise similarity of 0.2782. Lower values indicate better semantic separation.442- **Alignment Quality:** Aligned models achieve up to 20.2% R@1 in cross-lingual retrieval.443- **Recommendation:** 128d aligned for best cross-lingual performance444 445---446## 6.  Morphological Analysis (Experimental)447 448This 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.449 450### 6.1 Productivity & Complexity451 452| Metric | Value | Interpretation | Recommendation |453|--------|-------|----------------|----------------|454| Productivity Index | **5.000** | High morphological productivity | Reliable analysis |455| Idiomaticity Gap | **-0.189** | Low formulaic content | - |456 457### 6.2 Affix Inventory (Productive Units)458 459These 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.460 461#### Productive Prefixes462| Prefix | Examples |463|--------|----------|464| `-po` | poinkilong, pointounda, poninong |465| `-ko` | kopogonuan, kontinjen, kokomoi |466| `-mo` | monongkuyaan, mongingit, mohd |467| `-mi` | mind, millennium, minsingumbal |468| `-ma` | maru, many, matter |469 470#### Productive Suffixes471| Suffix | Examples |472|--------|----------|473| `-n` | louson, sukun, monongkuyaan |474| `-an` | monongkuyaan, kopogonuan, keahlian |475| `-on` | louson, southampton, unsubon |476| `-ng` | poinkilong, skateboarding, dropping |477 478### 6.3 Bound Stems (Lexical Roots)479 480Bound 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.481 482| Stem | Cohesion | Substitutability | Examples |483|------|----------|------------------|----------|484| `anga` | 1.64x | 146 contexts | ganga, tanga, manga |485| `ngan` | 1.88x | 34 contexts | songan, jangan, dengan |486| `oros` | 2.02x | 26 contexts | boros, oroso, doros |487| `anta` | 1.48x | 88 contexts | banta, manta, antad |488| `boro` | 2.19x | 19 contexts | boros, oboros, borough |489| `ongu` | 1.63x | 50 contexts | tongue, tongus, mongua |490| `impu` | 1.96x | 24 contexts | limpu, timpu, limput |491| `mont` | 1.81x | 26 contexts | monto, montk, monte |492| `ampa` | 1.48x | 47 contexts | campa, gampa, rampa |493| `uang` | 1.59x | 33 contexts | huang, duang, ruang |494| `ogun` | 1.79x | 21 contexts | oguno, pogun, koguno |495| `mpai` | 1.95x | 13 contexts | ampai, rumpai, mimpai |496 497### 6.4 Affix Compatibility (Co-occurrence)498 499This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.500 501| Prefix | Suffix | Frequency | Examples |502|--------|--------|-----------|----------|503| `-ko` | `-n` | 164 words | kolintuhunan, koyomutan |504| `-po` | `-n` | 148 words | poimpohon, porundangan |505| `-ko` | `-an` | 121 words | kolintuhunan, koyomutan |506| `-po` | `-an` | 109 words | porundangan, pomutulan |507| `-po` | `-on` | 39 words | poimpohon, potingkodon |508| `-ko` | `-on` | 37 words | kohinoon, kosogubon |509| `-mi` | `-ng` | 29 words | minanamong, minongisonong |510| `-mi` | `-n` | 23 words | million, miimpohon |511| `-mo` | `-ng` | 22 words | momoguring, moyang |512| `-po` | `-ng` | 16 words | poring, poning |513 514### 6.5 Recursive Morpheme Segmentation515 516Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).517 518| Word | Suggested Split | Confidence | Stem |519|------|-----------------|------------|------|520| kopomolobusan | **`ko-po-mo-lobus-an`** | 9.0 | `lobus` |521| popokobong | **`po-po-ko-bong`** | 7.5 | `bong` |522| pomokritik | **`po-mo-kritik`** | 6.0 | `kritik` |523| popobibas | **`po-po-bibas`** | 6.0 | `bibas` |524| momooboros | **`mo-mo-oboros`** | 6.0 | `oboros` |525| mamagakom | **`ma-ma-gakom`** | 6.0 | `gakom` |526| pomodolinan | **`po-mo-dolin-an`** | 4.5 | `dolin` |527| koingkuri | **`ko-ingkuri`** | 4.5 | `ingkuri` |528| tungkusan | **`tungkus-an`** | 4.5 | `tungkus` |529| pengurusan | **`pengurus-an`** | 4.5 | `pengurus` |530| kopogisuusuayan | **`ko-po-gisuusuay-an`** | 4.5 | `gisuusuay` |531| pesisiran | **`pesisir-an`** | 4.5 | `pesisir` |532| kopomoogian | **`ko-po-mo-ogian`** | 4.5 | `ogian` |533| pomudagangan | **`po-mudaga-ng-an`** | 4.5 | `mudaga` |534| pomobodilan | **`po-mo-bodil-an`** | 4.5 | `bodil` |535 536### 6.6 Linguistic Interpretation537 538> **Automated Insight:**539The language Central Dusun shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.540 541---542## 7. Summary & Recommendations543 544![Performance Dashboard](visualizations/performance_dashboard.png)545 546### Production Recommendations547 548| Component | Recommended | Rationale |549|-----------|-------------|-----------|550| Tokenizer | **64k BPE** | Best compression (4.96x) |551| N-gram | **2-gram** | Lowest perplexity (227) |552| Markov | **Context-4** | Highest predictability (97.6%) |553| Embeddings | **100d** | Balanced semantic capture and isotropy |554 555 556---557## Appendix: Metrics Glossary & Interpretation Guide558 559This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.560 561### Tokenizer Metrics562 563**Compression Ratio**564> *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.565>566> *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.567>568> *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.569 570**Average Token Length (Fertility)**571> *Definition:* Mean number of characters per token produced by the tokenizer.572>573> *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.574>575> *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.576 577**Unknown Token Rate (OOV Rate)**578> *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.579>580> *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.581>582> *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.583 584### N-gram Model Metrics585 586**Perplexity**587> *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.588>589> *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.590>591> *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.592 593**Entropy**594> *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.595>596> *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.597>598> *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.599 600**Coverage (Top-K)**601> *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.602>603> *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.604>605> *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.606 607### Markov Chain Metrics608 609**Average Entropy**610> *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.611>612> *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).613>614> *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.615 616**Branching Factor**617> *Definition:* Average number of unique next tokens observed for each context.618>619> *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).620>621> *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.622 623**Predictability**624> *Definition:* Derived metric: (1 - normalized_entropy) × 100%. Indicates how deterministic the model's predictions are.625>626> *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.627>628> *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.629 630### Vocabulary & Zipf's Law Metrics631 632**Zipf's Coefficient**633> *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.634>635> *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.636>637> *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.638 639**R² (Coefficient of Determination)**640> *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.641>642> *Intuition:* R² near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.643>644> *What to seek:* R² > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.645 646**Vocabulary Coverage**647> *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.648>649> *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.650>651> *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.652 653### Word Embedding Metrics654 655**Isotropy**656> *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.657>658> *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.659>660> *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.661 662**Average Norm**663> *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.664>665> *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.666>667> *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).668 669**Cosine Similarity**670> *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).671>672> *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.673>674> *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.675 676**t-SNE Visualization**677> *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.678>679> *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.680>681> *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.682 683### General Interpretation Guidelines684 6851. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).6862. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).6873. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.6884. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.6895. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.690 691 692### Visualizations Index693 694| Visualization | Description |695|---------------|-------------|696| Tokenizer Compression | Compression ratios by vocabulary size |697| Tokenizer Fertility | Average token length by vocabulary |698| Tokenizer OOV | Unknown token rates |699| Tokenizer Total Tokens | Total tokens by vocabulary |700| N-gram Perplexity | Perplexity by n-gram size |701| N-gram Entropy | Entropy by n-gram size |702| N-gram Coverage | Top pattern coverage |703| N-gram Unique | Unique n-gram counts |704| Markov Entropy | Entropy by context size |705| Markov Branching | Branching factor by context |706| Markov Contexts | Unique context counts |707| Zipf's Law | Frequency-rank distribution with fit |708| Vocab Frequency | Word frequency distribution |709| Top 20 Words | Most frequent words |710| Vocab Coverage | Cumulative coverage curve |711| Embedding Isotropy | Vector space uniformity |712| Embedding Norms | Vector magnitude distribution |713| Embedding Similarity | Word similarity heatmap |714| Nearest Neighbors | Similar words for key terms |715| t-SNE Words | 2D word embedding visualization |716| t-SNE Sentences | 2D sentence embedding visualization |717| Position Encoding | Encoding method comparison |718| Model Sizes | Storage requirements |719| Performance Dashboard | Comprehensive performance overview |720 721---722## About This Project723 724### Data Source725 726Models trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - a monthly snapshot of Wikipedia articles across 300+ languages.727 728### Project729 730A project by **[Wikilangs](https://wikilangs.org)** - Open-source NLP models for every Wikipedia language.731 732### Maintainer733 734[Omar Kamali](https://omarkamali.com) - [Omneity Labs](https://omneitylabs.com)735 736### Citation737 738If you use these models in your research, please cite:739 740```bibtex741@misc{wikilangs2025,742  author = {Kamali, Omar},743  title = {Wikilangs: Open NLP Models for Wikipedia Languages},744  year = {2025},745  doi = {10.5281/zenodo.18073153},746  publisher = {Zenodo},747  url = {https://huggingface.co/wikilangs}748  institution = {Omneity Labs}749}750```751 752### License753 754MIT License - Free for academic and commercial use.755 756### Links757 758- 🌐 Website: [wikilangs.org](https://wikilangs.org)759- 🤗 Models: [huggingface.co/wikilangs](https://huggingface.co/wikilangs)760- 📊 Data: [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)761- 👤 Author: [Omar Kamali](https://huggingface.co/omarkamali)762- 🤝 Sponsor: [Featherless AI](https://featherless.ai)763---764*Generated by Wikilangs Models Pipeline*765 766*Report Date: 2026-01-04 02:42:58*767