omarkamali commited on
Commit
395ebaa
·
verified ·
1 Parent(s): 40df33f

Upload all models and assets for en (latest)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +6 -0
  2. README.md +221 -0
  3. RESEARCH_REPORT.md +681 -0
  4. en_morph_tokenizer.json +0 -0
  5. models/embeddings/monolingual/en_128d.bin +3 -0
  6. models/embeddings/monolingual/en_128d.meta.json +1 -0
  7. models/embeddings/monolingual/en_128d_metadata.json +16 -0
  8. models/embeddings/monolingual/en_32d.bin +3 -0
  9. models/embeddings/monolingual/en_32d.meta.json +1 -0
  10. models/embeddings/monolingual/en_32d_metadata.json +16 -0
  11. models/embeddings/monolingual/en_64d.bin +3 -0
  12. models/embeddings/monolingual/en_64d.meta.json +1 -0
  13. models/embeddings/monolingual/en_64d_metadata.json +16 -0
  14. models/subword_markov/en_markov_ctx1_subword.parquet +3 -0
  15. models/subword_markov/en_markov_ctx1_subword_metadata.json +7 -0
  16. models/subword_markov/en_markov_ctx2_subword.parquet +3 -0
  17. models/subword_markov/en_markov_ctx2_subword_metadata.json +7 -0
  18. models/subword_markov/en_markov_ctx3_subword.parquet +3 -0
  19. models/subword_markov/en_markov_ctx3_subword_metadata.json +7 -0
  20. models/subword_markov/en_markov_ctx4_subword.parquet +3 -0
  21. models/subword_markov/en_markov_ctx4_subword_metadata.json +7 -0
  22. models/subword_ngram/en_2gram_subword.parquet +3 -0
  23. models/subword_ngram/en_2gram_subword_metadata.json +7 -0
  24. models/subword_ngram/en_3gram_subword.parquet +3 -0
  25. models/subword_ngram/en_3gram_subword_metadata.json +7 -0
  26. models/subword_ngram/en_4gram_subword.parquet +3 -0
  27. models/subword_ngram/en_4gram_subword_metadata.json +7 -0
  28. models/subword_ngram/en_5gram_subword.parquet +3 -0
  29. models/subword_ngram/en_5gram_subword_metadata.json +7 -0
  30. models/tokenizer/en_tokenizer_16k.model +3 -0
  31. models/tokenizer/en_tokenizer_16k.vocab +0 -0
  32. models/tokenizer/en_tokenizer_32k.model +3 -0
  33. models/tokenizer/en_tokenizer_32k.vocab +0 -0
  34. models/tokenizer/en_tokenizer_64k.model +3 -0
  35. models/tokenizer/en_tokenizer_64k.vocab +0 -0
  36. models/tokenizer/en_tokenizer_8k.model +3 -0
  37. models/tokenizer/en_tokenizer_8k.vocab +0 -0
  38. models/vocabulary/en_vocabulary.parquet +3 -0
  39. models/vocabulary/en_vocabulary_metadata.json +17 -0
  40. models/vocabulary/en_vocabulary_top.parquet +3 -0
  41. models/vocabulary/en_vocabulary_top_metadata.json +20 -0
  42. models/word_markov/en_markov_ctx1_word.parquet +3 -0
  43. models/word_markov/en_markov_ctx1_word_metadata.json +7 -0
  44. models/word_markov/en_markov_ctx2_word.parquet +3 -0
  45. models/word_markov/en_markov_ctx2_word_metadata.json +7 -0
  46. models/word_markov/en_markov_ctx3_word.parquet +3 -0
  47. models/word_markov/en_markov_ctx3_word_metadata.json +7 -0
  48. models/word_markov/en_markov_ctx4_word.parquet +3 -0
  49. models/word_markov/en_markov_ctx4_word_metadata.json +7 -0
  50. models/word_ngram/en_2gram_word.parquet +3 -0
.gitattributes CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ visualizations/embedding_similarity.png filter=lfs diff=lfs merge=lfs -text
37
+ visualizations/performance_dashboard.png filter=lfs diff=lfs merge=lfs -text
38
+ visualizations/position_encoding_comparison.png filter=lfs diff=lfs merge=lfs -text
39
+ visualizations/tsne_sentences.png filter=lfs diff=lfs merge=lfs -text
40
+ visualizations/tsne_words.png filter=lfs diff=lfs merge=lfs -text
41
+ visualizations/zipf_law.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ language_name: English
4
+ language_family: germanic_west_anglofrisian
5
+ tags:
6
+ - wikilangs
7
+ - nlp
8
+ - tokenizer
9
+ - embeddings
10
+ - n-gram
11
+ - markov
12
+ - wikipedia
13
+ - feature-extraction
14
+ - sentence-similarity
15
+ - tokenization
16
+ - n-grams
17
+ - markov-chain
18
+ - text-mining
19
+ - fasttext
20
+ - babelvec
21
+ - vocabulous
22
+ - vocabulary
23
+ - monolingual
24
+ - family-germanic_west_anglofrisian
25
+ license: mit
26
+ library_name: wikilangs
27
+ pipeline_tag: text-generation
28
+ datasets:
29
+ - omarkamali/wikipedia-monthly
30
+ dataset_info:
31
+ name: wikipedia-monthly
32
+ description: Monthly snapshots of Wikipedia articles across 300+ languages
33
+ metrics:
34
+ - name: best_compression_ratio
35
+ type: compression
36
+ value: 4.699
37
+ - name: best_isotropy
38
+ type: isotropy
39
+ value: 0.7693
40
+ - name: vocabulary_size
41
+ type: vocab
42
+ value: 1867537
43
+ generated: 2026-03-03
44
+ ---
45
+
46
+ # English — Wikilangs Models
47
+
48
+ Open-source tokenizers, n-gram & Markov language models, vocabulary stats, and word embeddings trained on **English** Wikipedia by [Wikilangs](https://wikilangs.org).
49
+
50
+ 🌐 [Language Page](https://wikilangs.org/languages/en/) · 🎮 [Playground](https://wikilangs.org/playground/?lang=en) · 📊 [Full Research Report](RESEARCH_REPORT.md)
51
+
52
+ ## Language Samples
53
+
54
+ Example sentences drawn from the English Wikipedia corpus:
55
+
56
+ > Alexander V may refer to: Alexander V of Macedon (died 294 BCE) Antipope Alexander V Alexander V of Imereti
57
+
58
+ > Alfonso IV may refer to: Alfonso IV of León (924–931) Afonso IV of Portugal Alfonso IV of Aragon Alfonso IV of Ribagorza Alfonso IV d'Este Duke of Modena and Regg
59
+
60
+ > Anastasius I or Anastasios I may refer to: Anastasius I Dicorus (–518), Roman emperor Anastasius I of Antioch (died 599), Patriarch of Antioch Pope Anastasius I (died 401), pope
61
+
62
+ > Angula may refer to: Aṅgula, a measure equal to a finger's breadth Eel, a biological order of fish Nahas Angula, former Prime Minister of Namibia Helmut Angula See also Angul (disambiguation)
63
+
64
+ > Two antipopes used the regnal name Victor IV: Antipope Victor IV Antipope Victor IV
65
+
66
+ ## Quick Start
67
+
68
+ ### Load the Tokenizer
69
+
70
+ ```python
71
+ import sentencepiece as spm
72
+
73
+ sp = spm.SentencePieceProcessor()
74
+ sp.Load("en_tokenizer_32k.model")
75
+
76
+ text = "Albrecht Achilles may refer to: Albrecht III Achilles, Elector of Brandenburg Al"
77
+ tokens = sp.EncodeAsPieces(text)
78
+ ids = sp.EncodeAsIds(text)
79
+
80
+ print(tokens) # subword pieces
81
+ print(ids) # integer ids
82
+
83
+ # Decode back
84
+ print(sp.DecodeIds(ids))
85
+ ```
86
+
87
+ <details>
88
+ <summary><b>Tokenization examples (click to expand)</b></summary>
89
+
90
+ **Sample 1:** `Albrecht Achilles may refer to: Albrecht III Achilles, Elector of Brandenburg Al…`
91
+
92
+ | Vocab | Tokens | Count |
93
+ |-------|--------|-------|
94
+ | 8k | `▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht … (+27 more)` | 37 |
95
+ | 16k | `▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht … (+26 more)` | 36 |
96
+ | 32k | `▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , … (+17 more)` | 27 |
97
+ | 64k | `▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , … (+16 more)` | 26 |
98
+
99
+ **Sample 2:** `Alexander V may refer to: Alexander V of Macedon (died 294 BCE) Antipope Alexand…`
100
+
101
+ | Vocab | Tokens | Count |
102
+ |-------|--------|-------|
103
+ | 8k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁maced … (+20 more)` | 30 |
104
+ | 16k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+18 more)` | 28 |
105
+ | 32k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+15 more)` | 25 |
106
+ | 64k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+15 more)` | 25 |
107
+
108
+ **Sample 3:** `Two antipopes used the regnal name Victor IV: Antipope Victor IV Antipope Victor…`
109
+
110
+ | Vocab | Tokens | Count |
111
+ |-------|--------|-------|
112
+ | 8k | `▁two ▁antip op es ▁used ▁the ▁reg nal ▁name ▁victor … (+8 more)` | 18 |
113
+ | 16k | `▁two ▁antip opes ▁used ▁the ▁reg nal ▁name ▁victor ▁iv … (+7 more)` | 17 |
114
+ | 32k | `▁two ▁antip opes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : … (+6 more)` | 16 |
115
+ | 64k | `▁two ▁antipopes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : ▁antipope … (+5 more)` | 15 |
116
+
117
+ </details>
118
+
119
+ ### Load Word Embeddings
120
+
121
+ ```python
122
+ from gensim.models import KeyedVectors
123
+
124
+ # Aligned embeddings (cross-lingual, mapped to English vector space)
125
+ wv = KeyedVectors.load("en_embeddings_128d_aligned.kv")
126
+
127
+ similar = wv.most_similar("word", topn=5)
128
+ for word, score in similar:
129
+ print(f" {word}: {score:.3f}")
130
+ ```
131
+
132
+ ### Load N-gram Model
133
+
134
+ ```python
135
+ import pyarrow.parquet as pq
136
+
137
+ df = pq.read_table("en_3gram_word.parquet").to_pandas()
138
+ print(df.head())
139
+ ```
140
+
141
+ ## Models Overview
142
+
143
+ ![Performance Dashboard](visualizations/performance_dashboard.png)
144
+
145
+ | Category | Assets |
146
+ |----------|--------|
147
+ | Tokenizers | BPE at 8k, 16k, 32k, 64k vocab sizes |
148
+ | N-gram models | 2 / 3 / 4 / 5-gram (word & subword) |
149
+ | Markov chains | Context 1–5 (word & subword) |
150
+ | Embeddings | 32d, 64d, 128d — mono & aligned |
151
+ | Vocabulary | Full frequency list + Zipf analysis |
152
+ | Statistics | Corpus & model statistics JSON |
153
+
154
+ ## Metrics Summary
155
+
156
+ | Component | Model | Key Metric | Value |
157
+ |-----------|-------|------------|-------|
158
+ | Tokenizer | 8k BPE | Compression | 3.84x |
159
+ | Tokenizer | 16k BPE | Compression | 4.22x |
160
+ | Tokenizer | 32k BPE | Compression | 4.51x |
161
+ | Tokenizer | 64k BPE | Compression | 4.70x 🏆 |
162
+ | N-gram | 2-gram (subword) | Perplexity | 257 🏆 |
163
+ | N-gram | 2-gram (word) | Perplexity | 386,225 |
164
+ | N-gram | 3-gram (subword) | Perplexity | 2,180 |
165
+ | N-gram | 3-gram (word) | Perplexity | 4,093,782 |
166
+ | N-gram | 4-gram (subword) | Perplexity | 12,758 |
167
+ | N-gram | 4-gram (word) | Perplexity | 14,465,722 |
168
+ | N-gram | 5-gram (subword) | Perplexity | 55,700 |
169
+ | N-gram | 5-gram (word) | Perplexity | 12,820,936 |
170
+ | Markov | ctx-1 (subword) | Predictability | 0.0% |
171
+ | Markov | ctx-1 (word) | Predictability | 6.2% |
172
+ | Markov | ctx-2 (subword) | Predictability | 46.4% |
173
+ | Markov | ctx-2 (word) | Predictability | 48.3% |
174
+ | Markov | ctx-3 (subword) | Predictability | 45.8% |
175
+ | Markov | ctx-3 (word) | Predictability | 75.9% |
176
+ | Markov | ctx-4 (subword) | Predictability | 36.8% |
177
+ | Markov | ctx-4 (word) | Predictability | 89.2% 🏆 |
178
+ | Vocabulary | full | Size | 1,867,537 |
179
+ | Vocabulary | full | Zipf R² | 0.9862 |
180
+ | Embeddings | mono_32d | Isotropy | 0.7693 🏆 |
181
+ | Embeddings | mono_64d | Isotropy | 0.7388 |
182
+ | Embeddings | mono_128d | Isotropy | 0.6687 |
183
+
184
+ 📊 **[Full ablation study, per-model breakdowns, and interpretation guide →](RESEARCH_REPORT.md)**
185
+
186
+ ---
187
+
188
+ ## About
189
+
190
+ Trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) — monthly snapshots of 300+ Wikipedia languages.
191
+
192
+ A project by **[Wikilangs](https://wikilangs.org)** · Maintainer: [Omar Kamali](https://omarkamali.com) · [Omneity Labs](https://omneitylabs.com)
193
+
194
+ ### Citation
195
+
196
+ ```bibtex
197
+ @misc{wikilangs2025,
198
+ author = {Kamali, Omar},
199
+ title = {Wikilangs: Open NLP Models for Wikipedia Languages},
200
+ year = {2025},
201
+ doi = {10.5281/zenodo.18073153},
202
+ publisher = {Zenodo},
203
+ url = {https://huggingface.co/wikilangs},
204
+ institution = {Omneity Labs}
205
+ }
206
+ ```
207
+
208
+ ### Links
209
+
210
+ - 🌐 [wikilangs.org](https://wikilangs.org)
211
+ - 🌍 [Language page](https://wikilangs.org/languages/en/)
212
+ - 🎮 [Playground](https://wikilangs.org/playground/?lang=en)
213
+ - 🤗 [HuggingFace models](https://huggingface.co/wikilangs)
214
+ - 📊 [wikipedia-monthly dataset](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)
215
+ - 👤 [Omar Kamali](https://huggingface.co/omarkamali)
216
+ - 🤝 Sponsor: [Featherless AI](https://featherless.ai)
217
+
218
+ **License:** MIT — free for academic and commercial use.
219
+
220
+ ---
221
+ *Generated by Wikilangs Pipeline · 2026-03-03 22:59:51*
RESEARCH_REPORT.md ADDED
@@ -0,0 +1,681 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # English — Full Ablation Study & Research Report
2
+
3
+ Detailed evaluation of all model variants trained on **English** Wikipedia data by [Wikilangs](https://wikilangs.org).
4
+
5
+ 👈 [Back to README](README.md)
6
+
7
+ ## 📋 Repository Contents
8
+
9
+ ### Models & Assets
10
+
11
+ - Tokenizers (8k, 16k, 32k, 64k)
12
+ - N-gram models (2, 3, 4, 5-gram)
13
+ - Markov chains (context of 1, 2, 3, 4 and 5)
14
+ - Subword N-gram and Markov chains
15
+ - Embeddings in various sizes and dimensions (aligned and unaligned)
16
+ - Language Vocabulary
17
+ - Language Statistics
18
+
19
+ ![Performance Dashboard](visualizations/performance_dashboard.png)
20
+
21
+ ### Analysis and Evaluation
22
+
23
+ - [1. Tokenizer Evaluation](#1-tokenizer-evaluation)
24
+ - [2. N-gram Model Evaluation](#2-n-gram-model-evaluation)
25
+ - [3. Markov Chain Evaluation](#3-markov-chain-evaluation)
26
+ - [4. Vocabulary Analysis](#4-vocabulary-analysis)
27
+ - [5. Word Embeddings Evaluation](#5-word-embeddings-evaluation)
28
+ - [6. Morphological Analysis (Experimental)](#6--morphological-analysis-experimental)
29
+ - [7. Summary & Recommendations](#7-summary--recommendations)
30
+ - [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide)
31
+ - [Visualizations Index](#visualizations-index)
32
+
33
+ ---
34
+ ## 1. Tokenizer Evaluation
35
+
36
+ ![Tokenizer Compression](visualizations/tokenizer_compression.png)
37
+
38
+ ![Tokenizer Fertility](visualizations/tokenizer_fertility.png)
39
+
40
+ ![Tokenizer OOV](visualizations/tokenizer_oov.png)
41
+
42
+ ![Total Tokens](visualizations/tokenizer_total_tokens.png)
43
+
44
+ ### Results
45
+
46
+ | Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |
47
+ |------------|-------------|---------------|----------|--------------|
48
+ | **8k** | 3.837x | 3.84 | 0.1338% | 6,415,993 |
49
+ | **16k** | 4.221x | 4.22 | 0.1472% | 5,832,191 |
50
+ | **32k** | 4.511x | 4.51 | 0.1573% | 5,458,111 |
51
+ | **64k** | 4.699x 🏆 | 4.70 | 0.1638% | 5,239,573 |
52
+
53
+ ### Tokenization Examples
54
+
55
+ Below are sample sentences tokenized with each vocabulary size:
56
+
57
+ **Sample 1:** `Albrecht Achilles may refer to: Albrecht III Achilles, Elector of Brandenburg Al...`
58
+
59
+ | Vocab | Tokens | Count |
60
+ |-------|--------|-------|
61
+ | 8k | `▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht ... (+27 more)` | 37 |
62
+ | 16k | `▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht ... (+26 more)` | 36 |
63
+ | 32k | `▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , ... (+17 more)` | 27 |
64
+ | 64k | `▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , ... (+16 more)` | 26 |
65
+
66
+ **Sample 2:** `Alexander V may refer to: Alexander V of Macedon (died 294 BCE) Antipope Alexand...`
67
+
68
+ | Vocab | Tokens | Count |
69
+ |-------|--------|-------|
70
+ | 8k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁maced ... (+20 more)` | 30 |
71
+ | 16k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon ... (+18 more)` | 28 |
72
+ | 32k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon ... (+15 more)` | 25 |
73
+ | 64k | `▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon ... (+15 more)` | 25 |
74
+
75
+ **Sample 3:** `Two antipopes used the regnal name Victor IV: Antipope Victor IV Antipope Victor...`
76
+
77
+ | Vocab | Tokens | Count |
78
+ |-------|--------|-------|
79
+ | 8k | `▁two ▁antip op es ▁used ▁the ▁reg nal ▁name ▁victor ... (+8 more)` | 18 |
80
+ | 16k | `▁two ▁antip opes ▁used ▁the ▁reg nal ▁name ▁victor ▁iv ... (+7 more)` | 17 |
81
+ | 32k | `▁two ▁antip opes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : ... (+6 more)` | 16 |
82
+ | 64k | `▁two ▁antipopes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : ▁antipope ... (+5 more)` | 15 |
83
+
84
+
85
+ ### Key Findings
86
+
87
+ - **Best Compression:** 64k achieves 4.699x compression
88
+ - **Lowest UNK Rate:** 8k with 0.1338% unknown tokens
89
+ - **Trade-off:** Larger vocabularies improve compression but increase model size
90
+ - **Recommendation:** 32k vocabulary provides optimal balance for production use
91
+
92
+ ---
93
+ ## 2. N-gram Model Evaluation
94
+
95
+ ![N-gram Perplexity](visualizations/ngram_perplexity.png)
96
+
97
+ ![N-gram Unique](visualizations/ngram_unique.png)
98
+
99
+ ![N-gram Coverage](visualizations/ngram_coverage.png)
100
+
101
+ ### Results
102
+
103
+ | N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |
104
+ |--------|---------|------------|---------|----------------|------------------|-------------------|
105
+ | **2-gram** | Word | 386,225 | 18.56 | 9,782,066 | 8.6% | 17.8% |
106
+ | **2-gram** | Subword | 257 🏆 | 8.01 | 64,688 | 68.7% | 99.4% |
107
+ | **3-gram** | Word | 4,093,782 | 21.97 | 29,170,233 | 2.0% | 6.5% |
108
+ | **3-gram** | Subword | 2,180 | 11.09 | 375,974 | 27.2% | 71.8% |
109
+ | **4-gram** | Word | 14,465,722 | 23.79 | 54,673,289 | 1.7% | 4.4% |
110
+ | **4-gram** | Subword | 12,758 | 13.64 | 2,193,365 | 14.2% | 38.3% |
111
+ | **5-gram** | Word | 12,820,936 | 23.61 | 37,691,280 | 2.5% | 5.0% |
112
+ | **5-gram** | Subword | 55,700 | 15.77 | 8,078,460 | 8.7% | 23.9% |
113
+
114
+ ### Top 5 N-grams by Size
115
+
116
+ **2-grams (Word):**
117
+
118
+ | Rank | N-gram | Count |
119
+ |------|--------|-------|
120
+ | 1 | `of the` | 7,591,708 |
121
+ | 2 | `in the` | 5,221,237 |
122
+ | 3 | `to the` | 2,361,743 |
123
+ | 4 | `and the` | 1,799,614 |
124
+ | 5 | `on the` | 1,518,298 |
125
+
126
+ **3-grams (Word):**
127
+
128
+ | Rank | N-gram | Count |
129
+ |------|--------|-------|
130
+ | 1 | `the united states` | 408,936 |
131
+ | 2 | `one of the` | 329,510 |
132
+ | 3 | `as well as` | 264,322 |
133
+ | 4 | `part of the` | 247,900 |
134
+ | 5 | `references external links` | 203,098 |
135
+
136
+ **4-grams (Word):**
137
+
138
+ | Rank | N-gram | Count |
139
+ |------|--------|-------|
140
+ | 1 | `in the united states` | 156,847 |
141
+ | 2 | `under the age of` | 101,794 |
142
+ | 3 | `the age of 18` | 97,188 |
143
+ | 4 | `the end of the` | 88,360 |
144
+ | 5 | `of age or older` | 86,112 |
145
+
146
+ **5-grams (Word):**
147
+
148
+ | Rank | N-gram | Count |
149
+ |------|--------|-------|
150
+ | 1 | `under the age of 18` | 95,573 |
151
+ | 2 | `years of age or older` | 85,203 |
152
+ | 3 | `65 years of age or` | 84,639 |
153
+ | 4 | `of age or older the` | 81,589 |
154
+ | 5 | `the median income for a` | 59,537 |
155
+
156
+ **2-grams (Subword):**
157
+
158
+ | Rank | N-gram | Count |
159
+ |------|--------|-------|
160
+ | 1 | `e _` | 117,498,416 |
161
+ | 2 | `_ t` | 97,071,904 |
162
+ | 3 | `t h` | 84,506,441 |
163
+ | 4 | `_ a` | 84,102,037 |
164
+ | 5 | `s _` | 80,981,888 |
165
+
166
+ **3-grams (Subword):**
167
+
168
+ | Rank | N-gram | Count |
169
+ |------|--------|-------|
170
+ | 1 | `_ t h` | 65,028,534 |
171
+ | 2 | `t h e` | 60,632,216 |
172
+ | 3 | `h e _` | 53,951,238 |
173
+ | 4 | `e d _` | 29,954,463 |
174
+ | 5 | `_ i n` | 29,022,901 |
175
+
176
+ **4-grams (Subword):**
177
+
178
+ | Rank | N-gram | Count |
179
+ |------|--------|-------|
180
+ | 1 | `_ t h e` | 55,274,199 |
181
+ | 2 | `t h e _` | 50,142,942 |
182
+ | 3 | `_ o f _` | 26,136,576 |
183
+ | 4 | `a n d _` | 22,544,155 |
184
+ | 5 | `_ a n d` | 20,891,023 |
185
+
186
+ **5-grams (Subword):**
187
+
188
+ | Rank | N-gram | Count |
189
+ |------|--------|-------|
190
+ | 1 | `_ t h e _` | 49,351,863 |
191
+ | 2 | `_ a n d _` | 20,550,921 |
192
+ | 3 | `_ o f _ t` | 8,921,160 |
193
+ | 4 | `n _ t h e` | 8,394,629 |
194
+ | 5 | `o f _ t h` | 8,311,158 |
195
+
196
+
197
+ ### Key Findings
198
+
199
+ - **Best Perplexity:** 2-gram (subword) with 257
200
+ - **Entropy Trend:** Decreases with larger n-grams (more predictable)
201
+ - **Coverage:** Top-1000 patterns cover ~24% of corpus
202
+ - **Recommendation:** 4-gram or 5-gram for best predictive performance
203
+
204
+ ---
205
+ ## 3. Markov Chain Evaluation
206
+
207
+ ![Markov Entropy](visualizations/markov_entropy.png)
208
+
209
+ ![Markov Contexts](visualizations/markov_contexts.png)
210
+
211
+ ![Markov Branching](visualizations/markov_branching.png)
212
+
213
+ ### Results
214
+
215
+ | Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |
216
+ |---------|---------|-------------|------------|------------------|-----------------|----------------|
217
+ | **1** | Word | 0.9382 | 1.916 | 19.86 | 4,365,871 | 6.2% |
218
+ | **1** | Subword | 1.2026 | 2.302 | 11.62 | 32,517 | 0.0% |
219
+ | **2** | Word | 0.5167 | 1.431 | 3.51 | 86,666,437 | 48.3% |
220
+ | **2** | Subword | 0.5363 | 1.450 | 3.31 | 377,790 | 46.4% |
221
+ | **3** | Word | 0.2409 | 1.182 | 1.68 | 303,940,373 | 75.9% |
222
+ | **3** | Subword | 0.5420 | 1.456 | 3.45 | 1,251,354 | 45.8% |
223
+ | **4** | Word | 0.1077 🏆 | 1.078 | 1.22 | 509,562,649 | 89.2% |
224
+ | **4** | Subword | 0.6319 | 1.550 | 3.50 | 4,322,061 | 36.8% |
225
+
226
+ ### Generated Text Samples (Word-based)
227
+
228
+ Below are text samples generated from each word-based Markov chain model:
229
+
230
+ **Context Size 1:**
231
+
232
+ 1. `the move in july 2 respectively the murders in e bachs art deco building society was`
233
+ 2. `of the death in the buachaille etive ship to the signaling involves neuronal signals as the`
234
+ 3. `and left by his hysterical night and chieftain of measure in allowed for a number 3`
235
+
236
+ **Context Size 2:**
237
+
238
+ 1. `of the big story is off limits to permanent employment in most notably in the shoot dying`
239
+ 2. `in the city of lübeck later sold to supermarkets hotels cinemas and four mpvs on the other`
240
+ 3. `to the limestone florida department of veteran hard rock version in featuring another lengthy playof...`
241
+
242
+ **Context Size 3:**
243
+
244
+ 1. `the united states was raised significantly due to the interplay of light color etc hearing protectio...`
245
+ 2. `one of the few performed to significant recognition notable achievements include first indian batsma...`
246
+ 3. `as well as finishing sixth in the ferrari 312b and stirling mosss lotus in which he took to`
247
+
248
+ **Context Size 4:**
249
+
250
+ 1. `in the united states helped revive the french economy with the marshall plan until the nys w shut do...`
251
+ 2. `under the age of 18 living with them 57 1 were married couples living together 9 4 had a`
252
+ 3. `the age of 18 living with them 44 6 were married couples living together 13 9 had a female`
253
+
254
+
255
+ ### Generated Text Samples (Subword-based)
256
+
257
+ Below are text samples generated from each subword-based Markov chain model:
258
+
259
+ **Context Size 1:**
260
+
261
+ 1. `_an_ainalltyarmo`
262
+ 2. `ere_isorandaltii`
263
+ 3. `agean._he_trhed,`
264
+
265
+ **Context Size 2:**
266
+
267
+ 1. `e_co-con_ithe_sto`
268
+ 2. `_the_gh_todent's_`
269
+ 3. `th_arantime'_toft`
270
+
271
+ **Context Size 3:**
272
+
273
+ 1. `_the_abird_native_`
274
+ 2. `the_10_olynoldavit`
275
+ 3. `he_der_–_to_the_fi`
276
+
277
+ **Context Size 4:**
278
+
279
+ 1. `_the_treased:_"indo`
280
+ 2. `the_unit_by_made_fi`
281
+ 3. `_of_indies_in_the_s`
282
+
283
+
284
+ ### Key Findings
285
+
286
+ - **Best Predictability:** Context-4 (word) with 89.2% predictability
287
+ - **Branching Factor:** Decreases with context size (more deterministic)
288
+ - **Memory Trade-off:** Larger contexts require more storage (4,322,061 contexts)
289
+ - **Recommendation:** Context-3 or Context-4 for text generation
290
+
291
+ ---
292
+ ## 4. Vocabulary Analysis
293
+
294
+ ![Zipf's Law](visualizations/zipf_law.png)
295
+
296
+ ![Top Words](visualizations/top20_words.png)
297
+
298
+ ![Coverage Curve](visualizations/vocab_coverage.png)
299
+
300
+ ### Statistics
301
+
302
+ | Metric | Value |
303
+ |--------|-------|
304
+ | Vocabulary Size | 1,867,537 |
305
+ | Total Tokens | 739,735,080 |
306
+ | Mean Frequency | 396.10 |
307
+ | Median Frequency | 4 |
308
+ | Frequency Std Dev | 51092.36 |
309
+
310
+ ### Most Common Words
311
+
312
+ | Rank | Word | Frequency |
313
+ |------|------|-----------|
314
+ | 1 | the | 50,118,217 |
315
+ | 2 | of | 26,210,950 |
316
+ | 3 | and | 20,755,074 |
317
+ | 4 | in | 19,609,387 |
318
+ | 5 | a | 14,271,839 |
319
+ | 6 | to | 14,219,669 |
320
+ | 7 | was | 7,449,828 |
321
+ | 8 | for | 5,821,739 |
322
+ | 9 | as | 5,815,121 |
323
+ | 10 | is | 5,683,775 |
324
+
325
+ ### Least Common Words (from vocabulary)
326
+
327
+ | Rank | Word | Frequency |
328
+ |------|------|-----------|
329
+ | 1 | brevetting | 2 |
330
+ | 2 | karuppukatti | 2 |
331
+ | 3 | cirrhatum | 2 |
332
+ | 4 | paða | 2 |
333
+ | 5 | вим | 2 |
334
+ | 6 | correya | 2 |
335
+ | 7 | bulamaq | 2 |
336
+ | 8 | boorik | 2 |
337
+ | 9 | spanishe | 2 |
338
+ | 10 | gitarrenmusik | 2 |
339
+
340
+ ### Zipf's Law Analysis
341
+
342
+ | Metric | Value |
343
+ |--------|-------|
344
+ | Zipf Coefficient | 1.0573 |
345
+ | R² (Goodness of Fit) | 0.986242 |
346
+ | Adherence Quality | **excellent** |
347
+
348
+ ### Coverage Analysis
349
+
350
+ | Top N Words | Coverage |
351
+ |-------------|----------|
352
+ | Top 100 | 38.8% |
353
+ | Top 1,000 | 61.6% |
354
+ | Top 5,000 | 80.1% |
355
+ | Top 10,000 | 86.4% |
356
+
357
+ ### Key Findings
358
+
359
+ - **Zipf Compliance:** R²=0.9862 indicates excellent adherence to Zipf's law
360
+ - **High Frequency Dominance:** Top 100 words cover 38.8% of corpus
361
+ - **Long Tail:** 1,857,537 words needed for remaining 13.6% coverage
362
+
363
+ ---
364
+ ## 5. Word Embeddings Evaluation
365
+
366
+ ![Embedding Isotropy](visualizations/embedding_isotropy.png)
367
+
368
+ ![Similarity Matrix](visualizations/embedding_similarity.png)
369
+
370
+ ![t-SNE Words](visualizations/tsne_words.png)
371
+
372
+ ![t-SNE Sentences](visualizations/tsne_sentences.png)
373
+
374
+
375
+ ### 5.1 Cross-Lingual Alignment
376
+
377
+ > *Note: Multilingual alignment visualization not available for this language.*
378
+
379
+
380
+ ### 5.2 Model Comparison
381
+
382
+ | Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
383
+ |-------|-----------|----------|------------------|---------------|----------------|
384
+ | **mono_32d** | 32 | 0.7693 🏆 | 0.4027 | N/A | N/A |
385
+ | **mono_64d** | 64 | 0.7388 | 0.3350 | N/A | N/A |
386
+ | **mono_128d** | 128 | 0.6687 | 0.2629 | N/A | N/A |
387
+
388
+ ### Key Findings
389
+
390
+ - **Best Isotropy:** mono_32d with 0.7693 (more uniform distribution)
391
+ - **Semantic Density:** Average pairwise similarity of 0.3335. Lower values indicate better semantic separation.
392
+ - **Alignment Quality:** No aligned models evaluated in this run.
393
+ - **Recommendation:** 128d aligned for best cross-lingual performance
394
+
395
+ ---
396
+ ## 6. Morphological Analysis (Experimental)
397
+
398
+ 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.
399
+
400
+ ### 6.1 Productivity & Complexity
401
+
402
+ | Metric | Value | Interpretation | Recommendation |
403
+ |--------|-------|----------------|----------------|
404
+ | Productivity Index | **5.000** | High morphological productivity | Reliable analysis |
405
+ | Idiomaticity Gap | **-0.793** | Low formulaic content | - |
406
+
407
+ ### 6.2 Affix Inventory (Productive Units)
408
+
409
+ 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.
410
+
411
+ #### Productive Prefixes
412
+ | Prefix | Examples |
413
+ |--------|----------|
414
+ | `-s` | skulltrail, scroggins, salatin |
415
+ | `-a` | alpana, ayopaya, aekyung |
416
+ | `-k` | kairos, kunigundes, kumwartok |
417
+ | `-m` | mapae, muktafi, meirás |
418
+ | `-c` | cutpurses, ceste, centurynear |
419
+ | `-p` | pustynsky, phet, propertys |
420
+ | `-w` | wnbd, wrestlerdecember, walska |
421
+ | `-t` | technor, tvmaze, twistor |
422
+
423
+ #### Productive Suffixes
424
+ | Suffix | Examples |
425
+ |--------|----------|
426
+ | `-s` | scroggins, donoughues, kairos |
427
+ | `-e` | forebode, mapae, tvmaze |
428
+ | `-n` | salatin, gedruckten, fursten |
429
+ | `-a` | alpana, ayopaya, flavicauda |
430
+ | `-r` | wrestlerdecember, haalandmanchester, shoulder |
431
+ | `-i` | rosai, badaczewski, muktafi |
432
+ | `-es` | donoughues, kunigundes, cutpurses |
433
+ | `-t` | stillmaticchart, phet, quenstedt |
434
+
435
+ ### 6.3 Bound Stems (Lexical Roots)
436
+
437
+ 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.
438
+
439
+ | Stem | Cohesion | Substitutability | Examples |
440
+ |------|----------|------------------|----------|
441
+ | `tter` | 1.46x | 1019 contexts | atter, otter, itter |
442
+ | `ubli` | 1.63x | 215 contexts | tubli, ublic, dubli |
443
+ | `ttle` | 1.45x | 375 contexts | attle, ittle, ottle |
444
+ | `ount` | 1.52x | 208 contexts | count, yount, fount |
445
+ | `ontr` | 1.54x | 183 contexts | ontra, kontr, contr |
446
+ | `icia` | 1.44x | 202 contexts | licia, ticia, nicia |
447
+ | `itie` | 1.57x | 129 contexts | mitie, nitie, itier |
448
+ | `esid` | 1.55x | 123 contexts | yesid, cesid, resid |
449
+ | `itio` | 1.46x | 142 contexts | aitio, ition, vitio |
450
+ | `rsit` | 1.96x | 37 contexts | ḥarsit, parsit, fersit |
451
+ | `ucti` | 1.73x | 60 contexts | aucti, fructi, ductis |
452
+ | `oduc` | 1.85x | 44 contexts | produc, koduck, roduco |
453
+
454
+ ### 6.4 Affix Compatibility (Co-occurrence)
455
+
456
+ This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
457
+
458
+ | Prefix | Suffix | Frequency | Examples |
459
+ |--------|--------|-----------|----------|
460
+ | `-s` | `-s` | 117 words | superhumps, squiggs |
461
+ | `-c` | `-s` | 102 words | cheirogaleus, cuddys |
462
+ | `-b` | `-s` | 88 words | betlemitas, bracelins |
463
+ | `-p` | `-s` | 88 words | paros, paars |
464
+ | `-a` | `-s` | 85 words | abdülhamids, aguasbonenses |
465
+ | `-s` | `-e` | 82 words | sulene, solene |
466
+ | `-m` | `-s` | 80 words | mascas, mollis |
467
+ | `-t` | `-s` | 78 words | tracklines, tirthankaras |
468
+ | `-m` | `-e` | 70 words | magnetoreceptive, matratze |
469
+ | `-c` | `-e` | 68 words | coudreville, clanvowe |
470
+
471
+ ### 6.5 Recursive Morpheme Segmentation
472
+
473
+ Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).
474
+
475
+ | Word | Suggested Split | Confidence | Stem |
476
+ |------|-----------------|------------|------|
477
+ | parintintin | **`parintin-t-in`** | 7.5 | `t` |
478
+ | haakonssen | **`haakons-s-en`** | 7.5 | `s` |
479
+ | writernet | **`writern-e-t`** | 7.5 | `e` |
480
+ | kyŏngsang | **`kyŏngs-a-ng`** | 7.5 | `a` |
481
+ | neoformalism | **`neoformali-s-m`** | 7.5 | `s` |
482
+ | counterfeit | **`counterfe-i-t`** | 7.5 | `i` |
483
+ | glossarist | **`glossari-s-t`** | 7.5 | `s` |
484
+ | guitarless | **`guitar-le-ss`** | 7.5 | `le` |
485
+ | kyoryusho | **`kyoryus-h-o`** | 7.5 | `h` |
486
+ | harrisonharrison | **`harrisonharri-s-on`** | 7.5 | `s` |
487
+ | frankowsk | **`frankow-s-k`** | 7.5 | `s` |
488
+ | pxseattle | **`pxseat-t-le`** | 7.5 | `t` |
489
+ | maribulan | **`maribu-l-an`** | 7.5 | `l` |
490
+ | slighhouses | **`slighhou-s-es`** | 7.5 | `s` |
491
+ | limaysaurus | **`limaysau-r-us`** | 7.5 | `r` |
492
+
493
+ ### 6.6 Linguistic Interpretation
494
+
495
+ > **Automated Insight:**
496
+ The language English shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
497
+
498
+ ---
499
+ ## 7. Summary & Recommendations
500
+
501
+ ![Performance Dashboard](visualizations/performance_dashboard.png)
502
+
503
+ ### Production Recommendations
504
+
505
+ | Component | Recommended | Rationale |
506
+ |-----------|-------------|-----------|
507
+ | Tokenizer | **64k BPE** | Best compression (4.70x) |
508
+ | N-gram | **2-gram** | Lowest perplexity (257) |
509
+ | Markov | **Context-4** | Highest predictability (89.2%) |
510
+ | Embeddings | **100d** | Balanced semantic capture and isotropy |
511
+
512
+
513
+ ---
514
+ ## Appendix: Metrics Glossary & Interpretation Guide
515
+
516
+ This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
517
+
518
+ ### Tokenizer Metrics
519
+
520
+ **Compression Ratio**
521
+ > *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
522
+ >
523
+ > *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.
524
+ >
525
+ > *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
526
+
527
+ **Average Token Length (Fertility)**
528
+ > *Definition:* Mean number of characters per token produced by the tokenizer.
529
+ >
530
+ > *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.
531
+ >
532
+ > *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
533
+
534
+ **Unknown Token Rate (OOV Rate)**
535
+ > *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
536
+ >
537
+ > *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
538
+ >
539
+ > *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
540
+
541
+ ### N-gram Model Metrics
542
+
543
+ **Perplexity**
544
+ > *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
545
+ >
546
+ > *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.
547
+ >
548
+ > *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
549
+
550
+ **Entropy**
551
+ > *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
552
+ >
553
+ > *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
554
+ >
555
+ > *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
556
+
557
+ **Coverage (Top-K)**
558
+ > *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.
559
+ >
560
+ > *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
561
+ >
562
+ > *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
563
+
564
+ ### Markov Chain Metrics
565
+
566
+ **Average Entropy**
567
+ > *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
568
+ >
569
+ > *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).
570
+ >
571
+ > *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
572
+
573
+ **Branching Factor**
574
+ > *Definition:* Average number of unique next tokens observed for each context.
575
+ >
576
+ > *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
577
+ >
578
+ > *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
579
+
580
+ **Predictability**
581
+ > *Definition:* Derived metric: (1 - normalized_entropy) × 100%. Indicates how deterministic the model's predictions are.
582
+ >
583
+ > *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
584
+ >
585
+ > *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
586
+
587
+ ### Vocabulary & Zipf's Law Metrics
588
+
589
+ **Zipf's Coefficient**
590
+ > *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
591
+ >
592
+ > *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
593
+ >
594
+ > *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
595
+
596
+ **R² (Coefficient of Determination)**
597
+ > *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
598
+ >
599
+ > *Intuition:* R² near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
600
+ >
601
+ > *What to seek:* R² > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
602
+
603
+ **Vocabulary Coverage**
604
+ > *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.
605
+ >
606
+ > *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
607
+ >
608
+ > *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
609
+
610
+ ### Word Embedding Metrics
611
+
612
+ **Isotropy**
613
+ > *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
614
+ >
615
+ > *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
616
+ >
617
+ > *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.
618
+
619
+ **Average Norm**
620
+ > *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.
621
+ >
622
+ > *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
623
+ >
624
+ > *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
625
+
626
+ **Cosine Similarity**
627
+ > *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
628
+ >
629
+ > *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
630
+ >
631
+ > *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
632
+
633
+ **t-SNE Visualization**
634
+ > *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
635
+ >
636
+ > *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
637
+ >
638
+ > *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
639
+
640
+ ### General Interpretation Guidelines
641
+
642
+ 1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
643
+ 2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
644
+ 3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
645
+ 4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
646
+ 5. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
647
+
648
+
649
+ ### Visualizations Index
650
+
651
+ | Visualization | Description |
652
+ |---------------|-------------|
653
+ | Tokenizer Compression | Compression ratios by vocabulary size |
654
+ | Tokenizer Fertility | Average token length by vocabulary |
655
+ | Tokenizer OOV | Unknown token rates |
656
+ | Tokenizer Total Tokens | Total tokens by vocabulary |
657
+ | N-gram Perplexity | Perplexity by n-gram size |
658
+ | N-gram Entropy | Entropy by n-gram size |
659
+ | N-gram Coverage | Top pattern coverage |
660
+ | N-gram Unique | Unique n-gram counts |
661
+ | Markov Entropy | Entropy by context size |
662
+ | Markov Branching | Branching factor by context |
663
+ | Markov Contexts | Unique context counts |
664
+ | Zipf's Law | Frequency-rank distribution with fit |
665
+ | Vocab Frequency | Word frequency distribution |
666
+ | Top 20 Words | Most frequent words |
667
+ | Vocab Coverage | Cumulative coverage curve |
668
+ | Embedding Isotropy | Vector space uniformity |
669
+ | Embedding Norms | Vector magnitude distribution |
670
+ | Embedding Similarity | Word similarity heatmap |
671
+ | Nearest Neighbors | Similar words for key terms |
672
+ | t-SNE Words | 2D word embedding visualization |
673
+ | t-SNE Sentences | 2D sentence embedding visualization |
674
+ | Position Encoding | Encoding method comparison |
675
+ | Model Sizes | Storage requirements |
676
+ | Performance Dashboard | Comprehensive performance overview |
677
+
678
+ ---
679
+ 👈 [Back to README](README.md)
680
+
681
+ *Generated by Wikilangs Pipeline · 2026-03-04 03:44:40*
en_morph_tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/embeddings/monolingual/en_128d.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31490d19d8c8328df5ec6e0fff8c7d0ac5e8c1a69f5e703a9345f39f0bd47bbc
3
+ size 3108059224
models/embeddings/monolingual/en_128d.meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"lang": "en", "dim": 128, "max_seq_len": 512, "is_aligned": false}
models/embeddings/monolingual/en_128d_metadata.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "en",
3
+ "dimension": 128,
4
+ "version": "monolingual",
5
+ "training_params": {
6
+ "algorithm": "skipgram",
7
+ "min_count": 5,
8
+ "window": 5,
9
+ "negative": 5,
10
+ "epochs": 5,
11
+ "encoding_method": "rope",
12
+ "dim": 128,
13
+ "threads": 40
14
+ },
15
+ "vocab_size": 1999599
16
+ }
models/embeddings/monolingual/en_32d.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80f506262fe6db21d26324de308fee0d23de84b07c45924ef461861d4c44ff09
3
+ size 804367192
models/embeddings/monolingual/en_32d.meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"lang": "en", "dim": 32, "max_seq_len": 512, "is_aligned": false}
models/embeddings/monolingual/en_32d_metadata.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "en",
3
+ "dimension": 32,
4
+ "version": "monolingual",
5
+ "training_params": {
6
+ "algorithm": "skipgram",
7
+ "min_count": 5,
8
+ "window": 5,
9
+ "negative": 5,
10
+ "epochs": 5,
11
+ "encoding_method": "rope",
12
+ "dim": 32,
13
+ "threads": 40
14
+ },
15
+ "vocab_size": 1999599
16
+ }
models/embeddings/monolingual/en_64d.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a33f6b119234b0886aaafe2d65aff5cb407a1d332962e046c5fc3e4632f7a12a
3
+ size 1572264536
models/embeddings/monolingual/en_64d.meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"lang": "en", "dim": 64, "max_seq_len": 512, "is_aligned": false}
models/embeddings/monolingual/en_64d_metadata.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "en",
3
+ "dimension": 64,
4
+ "version": "monolingual",
5
+ "training_params": {
6
+ "algorithm": "skipgram",
7
+ "min_count": 5,
8
+ "window": 5,
9
+ "negative": 5,
10
+ "epochs": 5,
11
+ "encoding_method": "rope",
12
+ "dim": 64,
13
+ "threads": 40
14
+ },
15
+ "vocab_size": 1999599
16
+ }
models/subword_markov/en_markov_ctx1_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6898197759d5339b2997cd6508502b2eef0b8c2f1d5959660a15c236164f0609
3
+ size 2087037
models/subword_markov/en_markov_ctx1_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 1,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_contexts": 32517,
6
+ "total_transitions": 4567360436
7
+ }
models/subword_markov/en_markov_ctx2_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:767f5e0274110bdedf3807d465cd0d7aa82239e53594db949da0125dd7e71070
3
+ size 10703949
models/subword_markov/en_markov_ctx2_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 2,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_contexts": 377790,
6
+ "total_transitions": 4566860436
7
+ }
models/subword_markov/en_markov_ctx3_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc0e6dbe235d30aef82dce7204e65693443e813f88248a20b6abc02d6112abad
3
+ size 35868682
models/subword_markov/en_markov_ctx3_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 3,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_contexts": 1251354,
6
+ "total_transitions": 4566360436
7
+ }
models/subword_markov/en_markov_ctx4_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b772973002a581e41e1b61602692b91a0ea8f76438f1e14609fdb59d8525bfd6
3
+ size 123942560
models/subword_markov/en_markov_ctx4_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 4,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_contexts": 4322061,
6
+ "total_transitions": 4565860436
7
+ }
models/subword_ngram/en_2gram_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e17cf331e26caa89531c865e89373ec38f5ec76b51b837bf1f7c69d24f08680c
3
+ size 876346
models/subword_ngram/en_2gram_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "n": 2,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_ngrams": 64688,
6
+ "total_ngrams": 4567360436
7
+ }
models/subword_ngram/en_3gram_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d70357eda20122c96a297ef82309d2bf03253bb5abee867429a1a1c9dd4aaf2
3
+ size 4735287
models/subword_ngram/en_3gram_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "n": 3,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_ngrams": 375974,
6
+ "total_ngrams": 4566860436
7
+ }
models/subword_ngram/en_4gram_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e80cb48bee4b79c14b1d72cf2ad03165b8f29cf429e262663d5c7f33dadac7c0
3
+ size 26303533
models/subword_ngram/en_4gram_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "n": 4,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_ngrams": 2193365,
6
+ "total_ngrams": 4566360436
7
+ }
models/subword_ngram/en_5gram_subword.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c59fac4af22819906fdb77d3d098fdd6b10fd8c5b8661b5928dee67cf520ad9e
3
+ size 97263015
models/subword_ngram/en_5gram_subword_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "n": 5,
3
+ "variant": "subword",
4
+ "language": "en",
5
+ "unique_ngrams": 8078460,
6
+ "total_ngrams": 4565860436
7
+ }
models/tokenizer/en_tokenizer_16k.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f92d9b660c8880abdbf0feb8037ac453d66092c0f61f288b94b1da8f6af940f
3
+ size 513744
models/tokenizer/en_tokenizer_16k.vocab ADDED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/en_tokenizer_32k.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd1dcf58448647385379ae643b63c8e66ad5975eaa492818382d6d7a23ac62b2
3
+ size 794055
models/tokenizer/en_tokenizer_32k.vocab ADDED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/en_tokenizer_64k.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43846f852bf00df9c6fb0cd01d5ffc995419992b396b0e5e081563ebbc184a3f
3
+ size 1344272
models/tokenizer/en_tokenizer_64k.vocab ADDED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/en_tokenizer_8k.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36fa36cc1fd70d0609badaadc8fe9a794b3b5354d08536edfffbdc1dfbe2987a
3
+ size 375905
models/tokenizer/en_tokenizer_8k.vocab ADDED
The diff for this file is too large to render. See raw diff
 
models/vocabulary/en_vocabulary.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:622f280858cb15ab242586780012921f831c0d43fc23ab4645d029dd91ffc12e
3
+ size 27742956
models/vocabulary/en_vocabulary_metadata.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "en",
3
+ "vocabulary_size": 1867537,
4
+ "variant": "full",
5
+ "statistics": {
6
+ "type_token_ratio": 0.005885068972522313,
7
+ "coverage": {
8
+ "top_100": 0.38715549248118775,
9
+ "top_1000": 0.6137221546637889,
10
+ "top_5000": 0.7986778069758872,
11
+ "top_10000": 0.8614204964940441
12
+ },
13
+ "hapax_count": 2500571,
14
+ "hapax_ratio": 0.5724608915347331,
15
+ "total_documents": 500000
16
+ }
17
+ }
models/vocabulary/en_vocabulary_top.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c394db91e0ea5c2df1b8edbcb92c757254ad262c979cd2ad0e13cbf65a55c17
3
+ size 14954034
models/vocabulary/en_vocabulary_top_metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "en",
3
+ "vocabulary_size": 1000000,
4
+ "variant": "top",
5
+ "statistics": {
6
+ "type_token_ratio": 0.005885068972522313,
7
+ "coverage": {
8
+ "top_100": 0.38715549248118775,
9
+ "top_1000": 0.6137221546637889,
10
+ "top_5000": 0.7986778069758872,
11
+ "top_10000": 0.8614204964940441
12
+ },
13
+ "hapax_count": 2500571,
14
+ "hapax_ratio": 0.5724608915347331,
15
+ "total_documents": 500000,
16
+ "top_vocab_size": 1000000,
17
+ "coverage_ratio": 0.9938164099315138,
18
+ "tokens_excluded": 867537
19
+ }
20
+ }
models/word_markov/en_markov_ctx1_word.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b6f0b134870eaeb28c38fb549045711bbe448ce8fbb6ad6835aa12768d12774
3
+ size 705240470
models/word_markov/en_markov_ctx1_word_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 1,
3
+ "variant": "word",
4
+ "language": "en",
5
+ "unique_contexts": 4365871,
6
+ "total_transitions": 741735651
7
+ }
models/word_markov/en_markov_ctx2_word.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0096ae82aeea5f83c5d43f7d786b406f08686747815e2bca99c6c47302f3260
3
+ size 2849380271
models/word_markov/en_markov_ctx2_word_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 2,
3
+ "variant": "word",
4
+ "language": "en",
5
+ "unique_contexts": 86666437,
6
+ "total_transitions": 741235651
7
+ }
models/word_markov/en_markov_ctx3_word.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40c61e8412d2022958dfa613a5508c3db80cc275692643339be245445f1e5217
3
+ size 6272671723
models/word_markov/en_markov_ctx3_word_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 3,
3
+ "variant": "word",
4
+ "language": "en",
5
+ "unique_contexts": 303940373,
6
+ "total_transitions": 740735651
7
+ }
models/word_markov/en_markov_ctx4_word.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4528201f24136ae399bdbe7539d8810f0b34cbe317ffc841744fff49cec4a9a
3
+ size 9324438581
models/word_markov/en_markov_ctx4_word_metadata.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "context_size": 4,
3
+ "variant": "word",
4
+ "language": "en",
5
+ "unique_contexts": 509562649,
6
+ "total_transitions": 740235651
7
+ }
models/word_ngram/en_2gram_word.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4414bd4ce8e6cdf75d83279181b84f837534c0bc56d45345b343b65212e7d3f
3
+ size 141057949