omarkamali commited on
Commit
8c16188
·
verified ·
1 Parent(s): e0a6f96

Upload all models and assets for shi (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. README.md +129 -672
  2. RESEARCH_REPORT.md +686 -0
  3. models/embeddings/aligned/shi_128d.bin +2 -2
  4. models/embeddings/aligned/shi_128d.projection.npy +1 -1
  5. models/embeddings/aligned/shi_128d_metadata.json +2 -2
  6. models/embeddings/aligned/shi_32d.bin +2 -2
  7. models/embeddings/aligned/shi_32d.projection.npy +1 -1
  8. models/embeddings/aligned/shi_32d_metadata.json +2 -2
  9. models/embeddings/aligned/shi_64d.bin +2 -2
  10. models/embeddings/aligned/shi_64d.projection.npy +1 -1
  11. models/embeddings/aligned/shi_64d_metadata.json +2 -2
  12. models/embeddings/monolingual/shi_128d.bin +2 -2
  13. models/embeddings/monolingual/shi_128d_metadata.json +2 -2
  14. models/embeddings/monolingual/shi_32d.bin +2 -2
  15. models/embeddings/monolingual/shi_32d_metadata.json +2 -2
  16. models/embeddings/monolingual/shi_64d.bin +2 -2
  17. models/embeddings/monolingual/shi_64d_metadata.json +2 -2
  18. models/subword_markov/shi_markov_ctx1_subword.parquet +2 -2
  19. models/subword_markov/shi_markov_ctx1_subword_metadata.json +2 -2
  20. models/subword_markov/shi_markov_ctx2_subword.parquet +2 -2
  21. models/subword_markov/shi_markov_ctx2_subword_metadata.json +2 -2
  22. models/subword_markov/shi_markov_ctx3_subword.parquet +2 -2
  23. models/subword_markov/shi_markov_ctx3_subword_metadata.json +2 -2
  24. models/subword_markov/shi_markov_ctx4_subword.parquet +2 -2
  25. models/subword_markov/shi_markov_ctx4_subword_metadata.json +2 -2
  26. models/subword_ngram/shi_2gram_subword.parquet +2 -2
  27. models/subword_ngram/shi_2gram_subword_metadata.json +2 -2
  28. models/subword_ngram/shi_3gram_subword.parquet +2 -2
  29. models/subword_ngram/shi_3gram_subword_metadata.json +2 -2
  30. models/subword_ngram/shi_4gram_subword.parquet +2 -2
  31. models/subword_ngram/shi_4gram_subword_metadata.json +2 -2
  32. models/subword_ngram/shi_5gram_subword.parquet +2 -2
  33. models/subword_ngram/shi_5gram_subword_metadata.json +2 -2
  34. models/tokenizer/shi_tokenizer_16k.model +2 -2
  35. models/tokenizer/shi_tokenizer_16k.vocab +0 -0
  36. models/tokenizer/shi_tokenizer_32k.model +2 -2
  37. models/tokenizer/shi_tokenizer_32k.vocab +0 -0
  38. models/tokenizer/shi_tokenizer_64k.model +2 -2
  39. models/tokenizer/shi_tokenizer_64k.vocab +0 -0
  40. models/tokenizer/shi_tokenizer_8k.model +2 -2
  41. models/tokenizer/shi_tokenizer_8k.vocab +0 -0
  42. models/vocabulary/shi_vocabulary.parquet +2 -2
  43. models/vocabulary/shi_vocabulary_metadata.json +8 -8
  44. models/word_markov/shi_markov_ctx1_word.parquet +2 -2
  45. models/word_markov/shi_markov_ctx1_word_metadata.json +2 -2
  46. models/word_markov/shi_markov_ctx2_word.parquet +2 -2
  47. models/word_markov/shi_markov_ctx2_word_metadata.json +2 -2
  48. models/word_markov/shi_markov_ctx3_word.parquet +2 -2
  49. models/word_markov/shi_markov_ctx3_word_metadata.json +2 -2
  50. models/word_markov/shi_markov_ctx4_word.parquet +2 -2
README.md CHANGED
@@ -36,738 +36,195 @@ metrics:
36
  value: 3.819
37
  - name: best_isotropy
38
  type: isotropy
39
- value: 0.7173
 
 
 
40
  - name: vocabulary_size
41
  type: vocab
42
- value: 0
43
- generated: 2026-01-10
44
  ---
45
 
46
- # Tachelhit - Wikilangs Models
47
- ## Comprehensive Research Report & Full Ablation Study
48
 
49
- This repository contains NLP models trained and evaluated by Wikilangs, specifically on **Tachelhit** Wikipedia data.
50
- We analyze tokenizers, n-gram models, Markov chains, vocabulary statistics, and word embeddings.
51
 
52
- ## 📋 Repository Contents
53
 
54
- ### Models & Assets
55
 
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 chains
60
- - Embeddings in various sizes and dimensions (aligned and unaligned)
61
- - Language Vocabulary
62
- - Language Statistics
63
 
64
- ![Performance Dashboard](visualizations/performance_dashboard.png)
65
 
66
- ### Analysis and Evaluation
67
 
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 Evaluation
80
 
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
- ### Results
 
90
 
91
- | Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |
92
- |------------|-------------|---------------|----------|--------------|
93
- | **8k** | 3.016x | 3.02 | 1.3945% | 407,897 |
94
- | **16k** | 3.301x | 3.30 | 1.5260% | 372,731 |
95
- | **32k** | 3.556x | 3.56 | 1.6440% | 345,980 |
96
- | **64k** | 3.819x 🏆 | 3.82 | 1.7653% | 322,212 |
97
 
98
- ### Tokenization Examples
 
99
 
100
- Below are sample sentences tokenized with each vocabulary size:
 
 
101
 
102
- **Sample 1:** `Talggut neɣ Algu tga yat tasklut ur iskaren awd yat ugummu, tesker ifrawen zund ...`
 
 
 
103
 
104
  | Vocab | Tokens | Count |
105
  |-------|--------|-------|
106
- | 8k | `▁tal gg utneɣal gutgayattas klut ... (+29 more)` | 39 |
107
- | 16k | `▁tal ggut ▁neɣalgutgayattaskluturiskar en ... (+22 more)` | 32 |
108
- | 32k | `▁talggut ▁neɣalgutgayattasklut ▁uriskarenawdyat ... (+20 more)` | 30 |
109
- | 64k | `▁talggutneɣalgutgayat ▁taskluturiskarenawdyat ... (+19 more)` | 29 |
110
 
111
- **Sample 2:** `1 000 iga yan umḍan imqquṛn, ism ns s tmaziɣt igat ifḍ (s tfinaɣ : ⵉⴼⴹ). Msmun a...`
112
 
113
  | Vocab | Tokens | Count |
114
  |-------|--------|-------|
115
- | 8k | `▁ 10 0 0 igayanumḍanimqquṛn ... (+30 more)` | 40 |
116
- | 16k | `▁ 10 0 0igayanumḍanimqquṛn ... (+29 more)` | 39 |
117
- | 32k | `▁ 10 0 0 igayanumḍanimqquṛn ... (+29 more)` | 39 |
118
- | 64k | `▁ 10 0 0 igayanumḍanimqquṛn ... (+29 more)` | 39 |
119
 
120
- **Sample 3:** `Iga Q yan sg iskkiln n ugmmay alatin n tmaziɣt. Tisaɣulin amaziɣ tamaziɣt`
121
 
122
  | Vocab | Tokens | Count |
123
  |-------|--------|-------|
124
- | 8k | `▁iga ▁qyan ▁sgiskkiln ▁n ▁ugmmayalatin ▁n ▁tmaziɣt ... (+4 more)` | 14 |
125
- | 16k | `▁iga ▁qyan ▁sgiskkiln ▁n ▁ugmmayalatin ▁ntmaziɣt ... (+4 more)` | 14 |
126
- | 32k | `▁igaq ▁yansg ▁iskkilnnugmmayalatinntmaziɣt ... (+4 more)` | 14 |
127
- | 64k | `▁igaq ▁yansg ▁iskkilnnugmmayalatinntmaziɣt ... (+4 more)` | 14 |
128
-
129
-
130
- ### Key Findings
131
-
132
- - **Best Compression:** 64k achieves 3.819x compression
133
- - **Lowest UNK Rate:** 8k with 1.3945% unknown tokens
134
- - **Trade-off:** Larger vocabularies improve compression but increase model size
135
- - **Recommendation:** 32k vocabulary provides optimal balance for production use
136
-
137
- ---
138
- ## 2. N-gram Model Evaluation
139
-
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
- ### Results
147
-
148
- | N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |
149
- |--------|---------|------------|---------|----------------|------------------|-------------------|
150
- | **2-gram** | Word | 1,027 | 10.00 | 23,236 | 45.7% | 81.7% |
151
- | **2-gram** | Subword | 255 🏆 | 7.99 | 3,781 | 68.8% | 99.0% |
152
- | **3-gram** | Word | 1,698 | 10.73 | 46,052 | 39.0% | 76.4% |
153
- | **3-gram** | Subword | 1,284 | 10.33 | 29,091 | 35.1% | 84.7% |
154
- | **4-gram** | Word | 3,109 | 11.60 | 90,307 | 35.2% | 68.9% |
155
- | **4-gram** | Subword | 3,344 | 11.71 | 117,787 | 23.5% | 73.6% |
156
- | **5-gram** | Word | 3,900 | 11.93 | 100,603 | 35.2% | 65.7% |
157
- | **5-gram** | Subword | 5,685 | 12.47 | 238,802 | 18.6% | 68.5% |
158
-
159
- ### Top 5 N-grams by Size
160
-
161
- **2-grams (Word):**
162
-
163
- | Rank | N-gram | Count |
164
- |------|--------|-------|
165
- | 1 | `tgmiḍi n` | 30,047 |
166
- | 2 | `n usggʷas` | 27,406 |
167
- | 3 | `umḍan n` | 26,921 |
168
- | 4 | `n imzdaɣn` | 25,250 |
169
- | 5 | `tlkm tgmiḍi` | 24,096 |
170
-
171
- **3-grams (Word):**
172
-
173
- | Rank | N-gram | Count |
174
- |------|--------|-------|
175
- | 1 | `tlkm tgmiḍi n` | 24,096 |
176
- | 2 | `tamattayt n usɣiws` | 16,122 |
177
- | 3 | `tasmirit tamattayt n` | 15,740 |
178
- | 4 | `umḍan n imzdaɣn` | 14,946 |
179
- | 5 | `g tlkm tgmiḍi` | 12,050 |
180
-
181
- **4-grams (Word):**
182
-
183
- | Rank | N-gram | Count |
184
- |------|--------|-------|
185
- | 1 | `tasmirit tamattayt n usɣiws` | 15,739 |
186
- | 2 | `g tlkm tgmiḍi n` | 12,050 |
187
- | 3 | `ad i trfiqt n` | 8,924 |
188
- | 4 | `uḍwwaṛ ad i trfiqt` | 8,917 |
189
- | 5 | `umḍan n imzdaɣn nns` | 8,916 |
190
-
191
- **5-grams (Word):**
192
-
193
- | Rank | N-gram | Count |
194
- |------|--------|-------|
195
- | 1 | `uḍwwaṛ ad i trfiqt n` | 8,916 |
196
- | 2 | `amatay n imzdaɣn tasmirit tamattayt` | 8,910 |
197
- | 3 | `imzdaɣn tasmirit tamattayt n usɣiws` | 8,910 |
198
- | 4 | `n imzdaɣn tasmirit tamattayt n` | 8,910 |
199
- | 5 | `ilkm umḍan n imzdaɣn nns` | 8,904 |
200
-
201
- **2-grams (Subword):**
202
-
203
- | Rank | N-gram | Count |
204
- |------|--------|-------|
205
- | 1 | `n _` | 653,867 |
206
- | 2 | `_ n` | 401,914 |
207
- | 3 | `_ t` | 358,373 |
208
- | 4 | `_ i` | 253,323 |
209
- | 5 | `t a` | 205,156 |
210
-
211
- **3-grams (Subword):**
212
-
213
- | Rank | N-gram | Count |
214
- |------|--------|-------|
215
- | 1 | `_ n _` | 294,487 |
216
- | 2 | `_ t a` | 132,536 |
217
- | 3 | `n _ t` | 104,627 |
218
- | 4 | `a n _` | 103,501 |
219
- | 5 | `_ ɣ _` | 101,865 |
220
-
221
- **4-grams (Subword):**
222
-
223
- | Rank | N-gram | Count |
224
- |------|--------|-------|
225
- | 1 | `_ n _ u` | 84,430 |
226
- | 2 | `t _ n _` | 67,376 |
227
- | 3 | `_ n _ i` | 61,495 |
228
- | 4 | `_ n _ t` | 56,122 |
229
- | 5 | `n _ u s` | 52,239 |
230
-
231
- **5-grams (Subword):**
232
-
233
- | Rank | N-gram | Count |
234
- |------|--------|-------|
235
- | 1 | `_ n _ u s` | 51,413 |
236
- | 2 | `m z d a ɣ` | 46,710 |
237
- | 3 | `g g ʷ a s` | 34,963 |
238
- | 4 | `s g g ʷ a` | 34,938 |
239
- | 5 | `_ n n a _` | 34,315 |
240
-
241
-
242
- ### Key Findings
243
-
244
- - **Best Perplexity:** 2-gram (subword) with 255
245
- - **Entropy Trend:** Decreases with larger n-grams (more predictable)
246
- - **Coverage:** Top-1000 patterns cover ~68% of corpus
247
- - **Recommendation:** 4-gram or 5-gram for best predictive performance
248
-
249
- ---
250
- ## 3. Markov Chain Evaluation
251
-
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
- ### Results
259
-
260
- | Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |
261
- |---------|---------|-------------|------------|------------------|-----------------|----------------|
262
- | **1** | Word | 0.6330 | 1.551 | 4.06 | 76,235 | 36.7% |
263
- | **1** | Subword | 1.2937 | 2.452 | 10.38 | 803 | 0.0% |
264
- | **2** | Word | 0.2598 | 1.197 | 1.65 | 308,778 | 74.0% |
265
- | **2** | Subword | 1.0718 | 2.102 | 6.52 | 8,338 | 0.0% |
266
- | **3** | Word | 0.0839 | 1.060 | 1.19 | 508,428 | 91.6% |
267
- | **3** | Subword | 0.8300 | 1.778 | 3.82 | 54,347 | 17.0% |
268
- | **4** | Word | 0.0475 🏆 | 1.033 | 1.13 | 601,160 | 95.2% |
269
- | **4** | Subword | 0.5641 | 1.478 | 2.43 | 207,735 | 43.6% |
270
-
271
- ### Generated Text Samples (Word-based)
272
-
273
- Below are text samples generated from each word-based Markov chain model:
274
-
275
- **Context Size 1:**
276
-
277
- 1. `n ayt twayya nna dar irgazn d amatay n usggʷas niɣ uggar ɣ ɛin ijri s`
278
- 2. `ɣ uḍwwaṛ innazwan yili ɣ lmɣrib iḍfaṛ uḍwwaṛ ad i twuri tannayin tisaɣulin ɣ llan 4`
279
- 3. `d 11 n tarwuri 2 ig unammas n tznit tamnaḍt n iḍuṛan ilkm wawtay nnsn iẓḍiṛn`
280
-
281
- **Context Size 2:**
282
-
283
- 1. `tgmiḍi n uslmd 92 86 gr irban d trbatin nna dar 15 n usggʷas démographiques et socio`
284
- 2. `n usggʷas démographiques et socio économiques de la population rurale hors nomades par douar selon l...`
285
- 3. `umḍan n imzdaɣn n usun ad 20 n iḍuṛan ilkm umḍan n twjiwin s 32 7 gr`
286
-
287
- **Context Size 3:**
288
-
289
- 1. `tlkm tgmiḍi n uslmd 100 gr irban d trbatin nna dar gr 6 d 11 n usggʷas ɣ`
290
- 2. `tamattayt n usɣiws tannayin tisaɣulin ɣ lmɣrib ɣ tsga n lḥuz n lḥuz n lḥuz n lḥuz n`
291
- 3. `tasmirit tamattayt n usɣiws ɣ iga umḍan n imawaḍn 224 n umzdaɣ gisn 581 n iwtman d 329`
292
-
293
- **Context Size 4:**
294
-
295
- 1. `tasmirit tamattayt n usɣiws ɣ iga umḍan n imawaḍn 236 n umzdaɣ gisn 110 n iwtman d 101 n`
296
- 2. `g tlkm tgmiḍi n uslmd 89 66 gr irban d trbatin nna dar gr 6 d 11 n usggʷas`
297
- 3. `ad i trfiqt n ayt iɛzman nna ɣ llan 4 n iḍuṛan ilkm umḍan n imzdaɣn nns 251 n`
298
-
299
-
300
- ### Generated Text Samples (Subword-based)
301
-
302
- Below are text samples generated from each subword-based Markov chain model:
303
-
304
- **Context Size 1:**
305
-
306
- 1. `_5_wtaṛsɣ_t_tana`
307
- 2. `aḍas_tm_aɣnaphon`
308
- 3. `nn_nn_puriquriɣ_`
309
-
310
- **Context Size 2:**
311
-
312
- 1. `n_muḍwwawtmas_soc`
313
- 2. `_n_et_tamklattamk`
314
- 3. `_tawtmadin_tlkm_u`
315
-
316
- **Context Size 3:**
317
 
318
- 1. `_n_imzdaɣn_nit_soc`
319
- 2. `_tarwurin_i_trfiqt`
320
- 3. `n_tawuri._tluḥarch`
321
 
322
- **Context Size 4:**
323
 
324
- 1. `_n_usɣiws._aṛcif,_1`
325
- 2. `t_n_iwtman_d_23.95_`
326
- 3. `_n_imzdaɣn_n_iwtman`
327
 
 
 
328
 
329
- ### Key Findings
330
-
331
- - **Best Predictability:** Context-4 (word) with 95.2% predictability
332
- - **Branching Factor:** Decreases with context size (more deterministic)
333
- - **Memory Trade-off:** Larger contexts require more storage (207,735 contexts)
334
- - **Recommendation:** Context-3 or Context-4 for text generation
335
-
336
- ---
337
- ## 4. Vocabulary Analysis
338
-
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
- ### Statistics
346
-
347
- | Metric | Value |
348
- |--------|-------|
349
- | Vocabulary Size | 31,610 |
350
- | Total Tokens | 2,378,642 |
351
- | Mean Frequency | 75.25 |
352
- | Median Frequency | 4 |
353
- | Frequency Std Dev | 1969.69 |
354
-
355
- ### Most Common Words
356
-
357
- | Rank | Word | Frequency |
358
- |------|------|-----------|
359
- | 1 | n | 294,685 |
360
- | 2 | ɣ | 101,988 |
361
- | 3 | d | 64,374 |
362
- | 4 | s | 34,997 |
363
- | 5 | nna | 34,361 |
364
- | 6 | imzdaɣn | 31,398 |
365
- | 7 | dar | 30,865 |
366
- | 8 | gr | 30,721 |
367
- | 9 | tgmiḍi | 30,050 |
368
- | 10 | usggʷas | 28,210 |
369
-
370
- ### Least Common Words (from vocabulary)
371
-
372
- | Rank | Word | Frequency |
373
- |------|------|-----------|
374
- | 1 | tdarwinit | 2 |
375
- | 2 | talmuqqdimt | 2 |
376
- | 3 | ttawnn | 2 |
377
- | 4 | taggrgist | 2 |
378
- | 5 | umdgar | 2 |
379
- | 6 | uqṛiḍ | 2 |
380
- | 7 | dearborn | 2 |
381
- | 8 | ghosts | 2 |
382
- | 9 | tremblay | 2 |
383
- | 10 | tmmndl | 2 |
384
-
385
- ### Zipf's Law Analysis
386
-
387
- | Metric | Value |
388
- |--------|-------|
389
- | Zipf Coefficient | 1.2849 |
390
- | R² (Goodness of Fit) | 0.988016 |
391
- | Adherence Quality | **excellent** |
392
-
393
- ### Coverage Analysis
394
-
395
- | Top N Words | Coverage |
396
- |-------------|----------|
397
- | Top 100 | 69.6% |
398
- | Top 1,000 | 90.6% |
399
- | Top 5,000 | 95.6% |
400
- | Top 10,000 | 97.3% |
401
-
402
- ### Key Findings
403
-
404
- - **Zipf Compliance:** R²=0.9880 indicates excellent adherence to Zipf's law
405
- - **High Frequency Dominance:** Top 100 words cover 69.6% of corpus
406
- - **Long Tail:** 21,610 words needed for remaining 2.7% coverage
407
-
408
- ---
409
- ## 5. Word Embeddings Evaluation
410
-
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 Alignment
421
-
422
- ![Alignment Quality](visualizations/embedding_alignment_quality.png)
423
-
424
- ![Multilingual t-SNE](visualizations/embedding_tsne_multilingual.png)
425
-
426
-
427
- ### 5.2 Model Comparison
428
-
429
- | Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
430
- |-------|-----------|----------|------------------|---------------|----------------|
431
- | **mono_32d** | 32 | 0.7173 | 0.3723 | N/A | N/A |
432
- | **mono_64d** | 64 | 0.5707 | 0.3238 | N/A | N/A |
433
- | **mono_128d** | 128 | 0.2225 | 0.3121 | N/A | N/A |
434
- | **aligned_32d** | 32 | 0.7173 🏆 | 0.3624 | 0.0140 | 0.0980 |
435
- | **aligned_64d** | 64 | 0.5707 | 0.3343 | 0.0280 | 0.1200 |
436
- | **aligned_128d** | 128 | 0.2225 | 0.3186 | 0.0400 | 0.1960 |
437
 
438
- ### Key Findings
439
 
440
- - **Best Isotropy:** aligned_32d with 0.7173 (more uniform distribution)
441
- - **Semantic Density:** Average pairwise similarity of 0.3372. Lower values indicate better semantic separation.
442
- - **Alignment Quality:** Aligned models achieve up to 4.0% R@1 in cross-lingual retrieval.
443
- - **Recommendation:** 128d aligned for best cross-lingual performance
444
 
445
- ---
446
- ## 6. Morphological Analysis (Experimental)
447
-
448
- 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.
449
-
450
- ### 6.1 Productivity & Complexity
451
-
452
- | Metric | Value | Interpretation | Recommendation |
453
- |--------|-------|----------------|----------------|
454
- | Productivity Index | **5.000** | High morphological productivity | Reliable analysis |
455
- | Idiomaticity Gap | **-0.041** | Low formulaic content | - |
456
-
457
- ### 6.2 Affix Inventory (Productive Units)
458
-
459
- 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.
460
-
461
- #### Productive Prefixes
462
- | Prefix | Examples |
463
- |--------|----------|
464
- | `-t` | tugt, tattuyt, tyyuga |
465
- | `-i` | issiks, imẓyann, izdg |
466
- | `-ta` | tattuyt, taryal, tamaẓuẓt |
467
- | `-a` | azdawan, amazɣ, afnsu |
468
- | `-u` | utin, uswaɣ, uzzugz |
469
- | `-l` | lmṣalḥa, lbkr, lmujawharat |
470
- | `-ti` | tizrigin, tidzi, timdst |
471
- | `-m` | maskurt, mḥda, mmaggarn |
472
-
473
- #### Productive Suffixes
474
- | Suffix | Examples |
475
- |--------|----------|
476
- | `-n` | utin, azdawan, tɣmriwin |
477
- | `-t` | tugt, tattuyt, trifiyt |
478
- | `-a` | tyyuga, mḥda, tssa |
479
- | `-in` | utin, tɣmriwin, ɣwin |
480
- | `-s` | issiks, chaouis, nations |
481
- | `-i` | inlbi, uɣri, igiddi |
482
- | `-e` | conduite, historique, déchirée |
483
- | `-an` | azdawan, zyyan, franslyan |
484
-
485
- ### 6.3 Bound Stems (Lexical Roots)
486
-
487
- 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.
488
-
489
- | Stem | Cohesion | Substitutability | Examples |
490
- |------|----------|------------------|----------|
491
- | `adda` | 1.65x | 52 contexts | addad, wadda, jadda |
492
- | `ggʷa` | 1.63x | 43 contexts | aggʷa, ḥggʷa, zggʷar |
493
- | `ggar` | 1.94x | 22 contexts | iggar, uggar, ggarn |
494
- | `ugga` | 1.94x | 21 contexts | uggar, uggan, yugga |
495
- | `wuri` | 1.68x | 30 contexts | twuri, iswuri, swurin |
496
- | `tion` | 2.09x | 14 contexts | notion, action, nation |
497
- | `ɣrib` | 1.80x | 20 contexts | aɣrib, mɣrib, lɣribi |
498
- | `lati` | 1.61x | 27 contexts | latin, latif, mulati |
499
- | `matt` | 1.60x | 26 contexts | matta, tmatti, umatta |
500
- | `mɣri` | 1.79x | 13 contexts | tmɣri, mɣrib, imɣri |
501
- | `atio` | 1.86x | 8 contexts | nation, nations, national |
502
- | `mata` | 1.45x | 14 contexts | amata, smata, umata |
503
-
504
- ### 6.4 Affix Compatibility (Co-occurrence)
505
-
506
- This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
507
-
508
- | Prefix | Suffix | Frequency | Examples |
509
- |--------|--------|-----------|----------|
510
- | `-t` | `-t` | 610 words | tifrirt, tdrfit |
511
- | `-i` | `-n` | 465 words | ittmttatn, ibṛbbachn |
512
- | `-t` | `-n` | 321 words | ttyussanin, tigtfulin |
513
- | `-t` | `-in` | 263 words | ttyussanin, tigtfulin |
514
- | `-l` | `-a` | 84 words | lbṛaṭla, lɛnabsa |
515
- | `-t` | `-a` | 65 words | tiṛṛuyṣa, tzuna |
516
- | `-i` | `-an` | 45 words | inultan, ilawan |
517
- | `-a` | `-i` | 39 words | adarazi, abriṭani |
518
- | `-a` | `-n` | 38 words | agwensan, agaman |
519
- | `-l` | `-t` | 32 words | lfwarat, lfuqqiyyat |
520
-
521
- ### 6.5 Recursive Morpheme Segmentation
522
-
523
- Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).
524
-
525
- | Word | Suggested Split | Confidence | Stem |
526
- |------|-----------------|------------|------|
527
- | tasnmḍant | **`tasnmḍ-an-t`** | 7.5 | `an` |
528
- | africaine | **`africa-in-e`** | 7.5 | `in` |
529
- | ttyawssannin | **`ttyawssan-n-in`** | 7.5 | `n` |
530
- | ittyurnan | **`ittyur-n-an`** | 7.5 | `n` |
531
- | ittusɣẓnn | **`ittusɣẓ-n-n`** | 7.5 | `n` |
532
- | zzuzzarnit | **`zzuzzar-n-it`** | 7.5 | `n` |
533
- | tutlayyin | **`tutlay-y-in`** | 7.5 | `y` |
534
- | ttaggʷanin | **`ttaggʷa-n-in`** | 7.5 | `n` |
535
- | marocaines | **`maroca-in-es`** | 7.5 | `in` |
536
- | government | **`governme-n-t`** | 7.5 | `n` |
537
- | ttussiḍannt | **`ttussiḍ-an-nt`** | 7.5 | `an` |
538
- | ittyawstay | **`ittyaws-t-ay`** | 7.5 | `t` |
539
- | patrimoine | **`patrimo-in-e`** | 7.5 | `in` |
540
- | ittuzdaɣn | **`it-tu-zdaɣn`** | 6.0 | `zdaɣn` |
541
- | tinsmunin | **`ti-nsmun-in`** | 6.0 | `nsmun` |
542
-
543
- ### 6.6 Linguistic Interpretation
544
-
545
- > **Automated Insight:**
546
- The language Tachelhit shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
547
 
548
- ---
549
- ## 7. Summary & Recommendations
550
 
551
  ![Performance Dashboard](visualizations/performance_dashboard.png)
552
 
553
- ### Production Recommendations
554
-
555
- | Component | Recommended | Rationale |
556
- |-----------|-------------|-----------|
557
- | Tokenizer | **64k BPE** | Best compression (3.82x) |
558
- | N-gram | **2-gram** | Lowest perplexity (255) |
559
- | Markov | **Context-4** | Highest predictability (95.2%) |
560
- | Embeddings | **100d** | Balanced semantic capture and isotropy |
561
-
562
-
563
- ---
564
- ## Appendix: Metrics Glossary & Interpretation Guide
565
-
566
- This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
567
-
568
- ### Tokenizer Metrics
569
-
570
- **Compression Ratio**
571
- > *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
572
- >
573
- > *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.
574
- >
575
- > *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
576
-
577
- **Average Token Length (Fertility)**
578
- > *Definition:* Mean number of characters per token produced by the tokenizer.
579
- >
580
- > *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.
581
- >
582
- > *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
583
-
584
- **Unknown Token Rate (OOV Rate)**
585
- > *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
586
- >
587
- > *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
588
- >
589
- > *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
590
-
591
- ### N-gram Model Metrics
592
-
593
- **Perplexity**
594
- > *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
595
- >
596
- > *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.
597
- >
598
- > *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
599
-
600
- **Entropy**
601
- > *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
602
- >
603
- > *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
604
- >
605
- > *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
606
-
607
- **Coverage (Top-K)**
608
- > *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.
609
- >
610
- > *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
611
- >
612
- > *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
613
-
614
- ### Markov Chain Metrics
615
-
616
- **Average Entropy**
617
- > *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
618
- >
619
- > *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).
620
- >
621
- > *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
622
-
623
- **Branching Factor**
624
- > *Definition:* Average number of unique next tokens observed for each context.
625
- >
626
- > *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
627
- >
628
- > *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
629
-
630
- **Predictability**
631
- > *Definition:* Derived metric: (1 - normalized_entropy) × 100%. Indicates how deterministic the model's predictions are.
632
- >
633
- > *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
634
- >
635
- > *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
636
-
637
- ### Vocabulary & Zipf's Law Metrics
638
-
639
- **Zipf's Coefficient**
640
- > *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
641
- >
642
- > *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
643
- >
644
- > *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
645
-
646
- **R² (Coefficient of Determination)**
647
- > *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
648
- >
649
- > *Intuition:* R² near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
650
- >
651
- > *What to seek:* R² > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
652
-
653
- **Vocabulary Coverage**
654
- > *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.
655
- >
656
- > *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
657
- >
658
- > *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
659
-
660
- ### Word Embedding Metrics
661
-
662
- **Isotropy**
663
- > *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
664
- >
665
- > *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
666
- >
667
- > *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.
668
-
669
- **Average Norm**
670
- > *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.
671
- >
672
- > *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
673
- >
674
- > *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
675
-
676
- **Cosine Similarity**
677
- > *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
678
- >
679
- > *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
680
- >
681
- > *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
682
-
683
- **t-SNE Visualization**
684
- > *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
685
- >
686
- > *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
687
- >
688
- > *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
689
-
690
- ### General Interpretation Guidelines
691
-
692
- 1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
693
- 2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
694
- 3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
695
- 4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
696
- 5. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
697
-
698
-
699
- ### Visualizations Index
700
-
701
- | Visualization | Description |
702
- |---------------|-------------|
703
- | Tokenizer Compression | Compression ratios by vocabulary size |
704
- | Tokenizer Fertility | Average token length by vocabulary |
705
- | Tokenizer OOV | Unknown token rates |
706
- | Tokenizer Total Tokens | Total tokens by vocabulary |
707
- | N-gram Perplexity | Perplexity by n-gram size |
708
- | N-gram Entropy | Entropy by n-gram size |
709
- | N-gram Coverage | Top pattern coverage |
710
- | N-gram Unique | Unique n-gram counts |
711
- | Markov Entropy | Entropy by context size |
712
- | Markov Branching | Branching factor by context |
713
- | Markov Contexts | Unique context counts |
714
- | Zipf's Law | Frequency-rank distribution with fit |
715
- | Vocab Frequency | Word frequency distribution |
716
- | Top 20 Words | Most frequent words |
717
- | Vocab Coverage | Cumulative coverage curve |
718
- | Embedding Isotropy | Vector space uniformity |
719
- | Embedding Norms | Vector magnitude distribution |
720
- | Embedding Similarity | Word similarity heatmap |
721
- | Nearest Neighbors | Similar words for key terms |
722
- | t-SNE Words | 2D word embedding visualization |
723
- | t-SNE Sentences | 2D sentence embedding visualization |
724
- | Position Encoding | Encoding method comparison |
725
- | Model Sizes | Storage requirements |
726
- | Performance Dashboard | Comprehensive performance overview |
727
 
728
  ---
729
- ## About This Project
730
-
731
- ### Data Source
732
 
733
- Models trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - a monthly snapshot of Wikipedia articles across 300+ languages.
734
 
735
- ### Project
736
 
737
- A project by **[Wikilangs](https://wikilangs.org)** - Open-source NLP models for every Wikipedia language.
738
-
739
- ### Maintainer
740
-
741
- [Omar Kamali](https://omarkamali.com) - [Omneity Labs](https://omneitylabs.com)
742
 
743
  ### Citation
744
 
745
- If you use these models in your research, please cite:
746
-
747
  ```bibtex
748
  @misc{wikilangs2025,
749
- author = {Kamali, Omar},
750
- title = {Wikilangs: Open NLP Models for Wikipedia Languages},
751
- year = {2025},
752
- doi = {10.5281/zenodo.18073153},
753
  publisher = {Zenodo},
754
- url = {https://huggingface.co/wikilangs}
755
  institution = {Omneity Labs}
756
  }
757
  ```
758
 
759
- ### License
760
-
761
- MIT License - Free for academic and commercial use.
762
-
763
  ### Links
764
 
765
- - 🌐 Website: [wikilangs.org](https://wikilangs.org)
766
- - 🤗 Models: [huggingface.co/wikilangs](https://huggingface.co/wikilangs)
767
- - 📊 Data: [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)
768
- - 👤 Author: [Omar Kamali](https://huggingface.co/omarkamali)
 
 
769
  - 🤝 Sponsor: [Featherless AI](https://featherless.ai)
770
- ---
771
- *Generated by Wikilangs Models Pipeline*
772
 
773
- *Report Date: 2026-01-10 20:02:34*
 
 
 
 
36
  value: 3.819
37
  - name: best_isotropy
38
  type: isotropy
39
+ value: 0.6948
40
+ - name: best_alignment_r10
41
+ type: alignment
42
+ value: 0.1780
43
  - name: vocabulary_size
44
  type: vocab
45
+ value: 31623
46
+ generated: 2026-03-02
47
  ---
48
 
49
+ # Tachelhit Wikilangs Models
 
50
 
51
+ Open-source tokenizers, n-gram & Markov language models, vocabulary stats, and word embeddings trained on **Tachelhit** Wikipedia by [Wikilangs](https://wikilangs.org).
 
52
 
53
+ 🌐 [Language Page](https://wikilangs.org/languages/shi/) · 🎮 [Playground](https://wikilangs.org/playground/?lang=shi) · 📊 [Full Research Report](RESEARCH_REPORT.md)
54
 
55
+ ## Language Samples
56
 
57
+ Example sentences drawn from the Tachelhit Wikipedia corpus:
 
 
 
 
 
 
58
 
59
+ > 11 yan d mraw ( s Taɛrabt احدى عشر ) ( s Tafṛensist onze ) iga yan izwl Msmun awal n SGSM : Msmun awal amatay asnmalay n tmaziɣt (MMSM) tisaɣulin
60
 
61
+ > 12 sin d mraw ( s Taɛrabt اثنى عشرة ) ( s Tafṛensist douze ) iga yan izwl Msmun awal n SGSM : Msmun awal amatay asnmalay n tmaziɣt (MMSM) tisaɣulin
62
 
63
+ > 13 kṛaḍ d merraw ( s Taɛrabt ثلاثة عشرة ) ( s Tafṛensist treize ) iga yan izwl Msmun awal n SGSM : Msmun awal amatay asnmalay n tmaziɣt (MMSM) tisaɣulin
 
 
 
 
 
 
 
 
64
 
65
+ > Acfud iga yat tasklut mẓẓin, ilan isnnann. Tiwlafin Assaɣ Tasnalɣa (morphologie) Anzwi Tisaɣulin
 
66
 
67
+ > Acnyal nɣ Aknyal agdudan aṣbnyuli, ɣ tgzzumt tiss 4.1 n tmnḍawt taṣbnyulit yuma kṛaḍ ikʷlan: aẓggaɣ d uwraɣ d uẓggaɣ daɣ. Tisaɣulin
68
 
69
+ ## Quick Start
70
 
71
+ ### Load the Tokenizer
72
 
73
+ ```python
74
+ import sentencepiece as spm
75
 
76
+ sp = spm.SentencePieceProcessor()
77
+ sp.Load("shi_tokenizer_32k.model")
78
 
79
+ text = "Sstekk iga yan ugḍiḍ imẓẓin. Assaɣ Tuzduɣt Tasnalɣa (morphologie) Tisaɣulin Msmu"
80
+ tokens = sp.EncodeAsPieces(text)
81
+ ids = sp.EncodeAsIds(text)
 
 
 
82
 
83
+ print(tokens) # subword pieces
84
+ print(ids) # integer ids
85
 
86
+ # Decode back
87
+ print(sp.DecodeIds(ids))
88
+ ```
89
 
90
+ <details>
91
+ <summary><b>Tokenization examples (click to expand)</b></summary>
92
+
93
+ **Sample 1:** `Sstekk iga yan ugḍiḍ imẓẓin. Assaɣ Tuzduɣt Tasnalɣa (morphologie) Tisaɣulin Msmu…`
94
 
95
  | Vocab | Tokens | Count |
96
  |-------|--------|-------|
97
+ | 8k | `▁s ste kkigayan ▁ugḍiḍimẓẓin . assaɣtuzduɣt (+19 more)` | 29 |
98
+ | 16k | `▁s ste kkigayanugḍiḍimẓẓin . assaɣtuzduɣt (+19 more)` | 29 |
99
+ | 32k | `▁s stekkigayanugḍiḍimẓẓin .assaɣtuzduɣttasnal��a (+18 more)` | 28 |
100
+ | 64k | `▁sstekkigayanugḍiḍimẓẓin .assaɣtuzduɣttasnalɣa( (+17 more)` | 27 |
101
 
102
+ **Sample 2:** `Asimwas iga ass wiss Smmus g ussan n imalass. Tisaɣulin`
103
 
104
  | Vocab | Tokens | Count |
105
  |-------|--------|-------|
106
+ | 8k | `▁as im was iga ▁ass ▁wisssmmusgussann (+3 more)` | 13 |
107
+ | 16k | `▁as imwasiga ▁ass ▁wiss ▁smmusgussannimalass (+2 more)` | 12 |
108
+ | 32k | `▁asimwas ▁igaass ▁wiss ▁smmusgussannimalass . (+1 more)` | 11 |
109
+ | 64k | `▁asimwas ▁igaass ▁wiss ▁smmusgussannimalass . (+1 more)` | 11 |
110
 
111
+ **Sample 3:** `Turdut (S turdut: اردو ) tga tutlayt nna s sawaln ayt Bakistan d Lhnd. Isuɣal`
112
 
113
  | Vocab | Tokens | Count |
114
  |-------|--------|-------|
115
+ | 8k | `▁tur dut( stur dut :ا ر دو (+14 more)` | 24 |
116
+ | 16k | `▁tur dut( stur dut :ار دو) (+13 more)` | 23 |
117
+ | 32k | `▁turdut( sturdut :اردو)tgatutlaytnna (+9 more)` | 19 |
118
+ | 64k | `▁turdut( sturdut :اردو)tgatutlaytnna (+8 more)` | 18 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
+ </details>
 
 
121
 
122
+ ### Load Word Embeddings
123
 
124
+ ```python
125
+ from gensim.models import KeyedVectors
 
126
 
127
+ # Aligned embeddings (cross-lingual, mapped to English vector space)
128
+ wv = KeyedVectors.load("shi_embeddings_128d_aligned.kv")
129
 
130
+ similar = wv.most_similar("word", topn=5)
131
+ for word, score in similar:
132
+ print(f" {word}: {score:.3f}")
133
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
+ ### Load N-gram Model
136
 
137
+ ```python
138
+ import pyarrow.parquet as pq
 
 
139
 
140
+ df = pq.read_table("shi_3gram_word.parquet").to_pandas()
141
+ print(df.head())
142
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
+ ## Models Overview
 
145
 
146
  ![Performance Dashboard](visualizations/performance_dashboard.png)
147
 
148
+ | Category | Assets |
149
+ |----------|--------|
150
+ | Tokenizers | BPE at 8k, 16k, 32k, 64k vocab sizes |
151
+ | N-gram models | 2 / 3 / 4 / 5-gram (word & subword) |
152
+ | Markov chains | Context 1–5 (word & subword) |
153
+ | Embeddings | 32d, 64d, 128d mono & aligned |
154
+ | Vocabulary | Full frequency list + Zipf analysis |
155
+ | Statistics | Corpus & model statistics JSON |
156
+
157
+ ## Metrics Summary
158
+
159
+ | Component | Model | Key Metric | Value |
160
+ |-----------|-------|------------|-------|
161
+ | Tokenizer | 8k BPE | Compression | 3.02x |
162
+ | Tokenizer | 16k BPE | Compression | 3.30x |
163
+ | Tokenizer | 32k BPE | Compression | 3.56x |
164
+ | Tokenizer | 64k BPE | Compression | 3.82x 🏆 |
165
+ | N-gram | 2-gram (subword) | Perplexity | 255 🏆 |
166
+ | N-gram | 2-gram (word) | Perplexity | 1,027 |
167
+ | N-gram | 3-gram (subword) | Perplexity | 1,284 |
168
+ | N-gram | 3-gram (word) | Perplexity | 1,698 |
169
+ | N-gram | 4-gram (subword) | Perplexity | 3,345 |
170
+ | N-gram | 4-gram (word) | Perplexity | 3,109 |
171
+ | N-gram | 5-gram (subword) | Perplexity | 5,689 |
172
+ | N-gram | 5-gram (word) | Perplexity | 3,900 |
173
+ | Markov | ctx-1 (subword) | Predictability | 0.0% |
174
+ | Markov | ctx-1 (word) | Predictability | 36.7% |
175
+ | Markov | ctx-2 (subword) | Predictability | 0.0% |
176
+ | Markov | ctx-2 (word) | Predictability | 74.0% |
177
+ | Markov | ctx-3 (subword) | Predictability | 17.0% |
178
+ | Markov | ctx-3 (word) | Predictability | 91.6% |
179
+ | Markov | ctx-4 (subword) | Predictability | 43.6% |
180
+ | Markov | ctx-4 (word) | Predictability | 95.2% 🏆 |
181
+ | Vocabulary | full | Size | 31,623 |
182
+ | Vocabulary | full | Zipf | 0.9880 |
183
+ | Embeddings | mono_32d | Isotropy | 0.6948 |
184
+ | Embeddings | mono_64d | Isotropy | 0.5226 |
185
+ | Embeddings | mono_128d | Isotropy | 0.2352 |
186
+ | Embeddings | aligned_32d | Isotropy | 0.6948 🏆 |
187
+ | Embeddings | aligned_64d | Isotropy | 0.5226 |
188
+ | Embeddings | aligned_128d | Isotropy | 0.2352 |
189
+ | Alignment | aligned_32d | R@1 / R@5 / R@10 | 0.6% / 2.0% / 5.4% |
190
+ | Alignment | aligned_64d | R@1 / R@5 / R@10 | 2.4% / 8.0% / 12.8% |
191
+ | Alignment | aligned_128d | R@1 / R@5 / R@10 | 3.6% / 11.2% / 17.8% 🏆 |
192
+
193
+ 📊 **[Full ablation study, per-model breakdowns, and interpretation guide →](RESEARCH_REPORT.md)**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
  ---
 
 
 
196
 
197
+ ## About
198
 
199
+ Trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) — monthly snapshots of 300+ Wikipedia languages.
200
 
201
+ A project by **[Wikilangs](https://wikilangs.org)** · Maintainer: [Omar Kamali](https://omarkamali.com) · [Omneity Labs](https://omneitylabs.com)
 
 
 
 
202
 
203
  ### Citation
204
 
 
 
205
  ```bibtex
206
  @misc{wikilangs2025,
207
+ author = {Kamali, Omar},
208
+ title = {Wikilangs: Open NLP Models for Wikipedia Languages},
209
+ year = {2025},
210
+ doi = {10.5281/zenodo.18073153},
211
  publisher = {Zenodo},
212
+ url = {https://huggingface.co/wikilangs},
213
  institution = {Omneity Labs}
214
  }
215
  ```
216
 
 
 
 
 
217
  ### Links
218
 
219
+ - 🌐 [wikilangs.org](https://wikilangs.org)
220
+ - 🌍 [Language page](https://wikilangs.org/languages/shi/)
221
+ - 🎮 [Playground](https://wikilangs.org/playground/?lang=shi)
222
+ - 🤗 [HuggingFace models](https://huggingface.co/wikilangs)
223
+ - 📊 [wikipedia-monthly dataset](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)
224
+ - 👤 [Omar Kamali](https://huggingface.co/omarkamali)
225
  - 🤝 Sponsor: [Featherless AI](https://featherless.ai)
 
 
226
 
227
+ **License:** MIT — free for academic and commercial use.
228
+
229
+ ---
230
+ *Generated by Wikilangs Pipeline · 2026-03-02 12:00:32*
RESEARCH_REPORT.md ADDED
@@ -0,0 +1,686 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Tachelhit — Full Ablation Study & Research Report
2
+
3
+ Detailed evaluation of all model variants trained on **Tachelhit** 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.017x | 3.02 | 1.3938% | 408,453 |
49
+ | **16k** | 3.301x | 3.30 | 1.5252% | 373,263 |
50
+ | **32k** | 3.557x | 3.56 | 1.6432% | 346,460 |
51
+ | **64k** | 3.819x 🏆 | 3.82 | 1.7643% | 322,672 |
52
+
53
+ ### Tokenization Examples
54
+
55
+ Below are sample sentences tokenized with each vocabulary size:
56
+
57
+ **Sample 1:** `Sstekk iga yan ugḍiḍ imẓẓin. Assaɣ Tuzduɣt Tasnalɣa (morphologie) Tisaɣulin Msmu...`
58
+
59
+ | Vocab | Tokens | Count |
60
+ |-------|--------|-------|
61
+ | 8k | `▁s ste kk ▁iga ▁yan ▁ugḍiḍ ▁imẓẓin . ▁assaɣ ▁tuzduɣt ... (+19 more)` | 29 |
62
+ | 16k | `▁s ste kk ▁iga ▁yan ▁ugḍiḍ ▁imẓẓin . ▁assaɣ ▁tuzduɣt ... (+19 more)` | 29 |
63
+ | 32k | `▁s stekk ▁iga ▁yan ▁ugḍiḍ ▁imẓẓin . ▁assaɣ ▁tuzduɣt ▁tasnalɣa ... (+18 more)` | 28 |
64
+ | 64k | `▁sstekk ▁iga ▁yan ▁ugḍiḍ ▁imẓẓin . ▁assaɣ ▁tuzduɣt ▁tasnalɣa ▁( ... (+17 more)` | 27 |
65
+
66
+ **Sample 2:** `Asimwas iga ass wiss Smmus g ussan n imalass. Tisaɣulin`
67
+
68
+ | Vocab | Tokens | Count |
69
+ |-------|--------|-------|
70
+ | 8k | `▁as im was ▁iga ▁ass ▁wiss ▁smmus ▁g ▁ussan ▁n ... (+3 more)` | 13 |
71
+ | 16k | `▁as imwas ▁iga ▁ass ▁wiss ▁smmus ▁g ▁ussan ▁n ▁imalass ... (+2 more)` | 12 |
72
+ | 32k | `▁asimwas ▁iga ▁ass ▁wiss ▁smmus ▁g ▁ussan ▁n ▁imalass . ... (+1 more)` | 11 |
73
+ | 64k | `▁asimwas ▁iga ▁ass ▁wiss ▁smmus ▁g ▁ussan ▁n ▁imalass . ... (+1 more)` | 11 |
74
+
75
+ **Sample 3:** `Turdut (S turdut: اردو ) tga tutlayt nna s sawaln ayt Bakistan d Lhnd. Isuɣal`
76
+
77
+ | Vocab | Tokens | Count |
78
+ |-------|--------|-------|
79
+ | 8k | `▁tur dut ▁( s ▁tur dut : ▁ا ر دو ... (+14 more)` | 24 |
80
+ | 16k | `▁tur dut ▁( s ▁tur dut : ▁ار دو ▁) ... (+13 more)` | 23 |
81
+ | 32k | `▁turdut ▁( s ▁turdut : ▁اردو ▁) ▁tga ▁tutlayt ▁nna ... (+9 more)` | 19 |
82
+ | 64k | `▁turdut ▁( s ▁turdut : ▁اردو ▁) ▁tga ▁tutlayt ▁nna ... (+8 more)` | 18 |
83
+
84
+
85
+ ### Key Findings
86
+
87
+ - **Best Compression:** 64k achieves 3.819x compression
88
+ - **Lowest UNK Rate:** 8k with 1.3938% 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 | 1,027 | 10.00 | 23,244 | 45.7% | 81.7% |
106
+ | **2-gram** | Subword | 255 🏆 | 7.99 | 3,782 | 68.8% | 99.0% |
107
+ | **3-gram** | Word | 1,698 | 10.73 | 46,062 | 39.0% | 76.4% |
108
+ | **3-gram** | Subword | 1,284 | 10.33 | 29,101 | 35.1% | 84.7% |
109
+ | **4-gram** | Word | 3,109 | 11.60 | 90,318 | 35.2% | 68.9% |
110
+ | **4-gram** | Subword | 3,345 | 11.71 | 117,821 | 23.5% | 73.6% |
111
+ | **5-gram** | Word | 3,900 | 11.93 | 100,607 | 35.2% | 65.7% |
112
+ | **5-gram** | Subword | 5,689 | 12.47 | 238,898 | 18.6% | 68.5% |
113
+
114
+ ### Top 5 N-grams by Size
115
+
116
+ **2-grams (Word):**
117
+
118
+ | Rank | N-gram | Count |
119
+ |------|--------|-------|
120
+ | 1 | `tgmiḍi n` | 30,047 |
121
+ | 2 | `n usggʷas` | 27,406 |
122
+ | 3 | `umḍan n` | 26,921 |
123
+ | 4 | `n imzdaɣn` | 25,250 |
124
+ | 5 | `tlkm tgmiḍi` | 24,096 |
125
+
126
+ **3-grams (Word):**
127
+
128
+ | Rank | N-gram | Count |
129
+ |------|--------|-------|
130
+ | 1 | `tlkm tgmiḍi n` | 24,096 |
131
+ | 2 | `tamattayt n usɣiws` | 16,122 |
132
+ | 3 | `tasmirit tamattayt n` | 15,740 |
133
+ | 4 | `umḍan n imzdaɣn` | 14,946 |
134
+ | 5 | `g tlkm tgmiḍi` | 12,050 |
135
+
136
+ **4-grams (Word):**
137
+
138
+ | Rank | N-gram | Count |
139
+ |------|--------|-------|
140
+ | 1 | `tasmirit tamattayt n usɣiws` | 15,739 |
141
+ | 2 | `g tlkm tgmiḍi n` | 12,050 |
142
+ | 3 | `ad i trfiqt n` | 8,924 |
143
+ | 4 | `uḍwwaṛ ad i trfiqt` | 8,917 |
144
+ | 5 | `umḍan n imzdaɣn nns` | 8,916 |
145
+
146
+ **5-grams (Word):**
147
+
148
+ | Rank | N-gram | Count |
149
+ |------|--------|-------|
150
+ | 1 | `uḍwwaṛ ad i trfiqt n` | 8,916 |
151
+ | 2 | `n imzdaɣn tasmirit tamattayt n` | 8,910 |
152
+ | 3 | `amatay n imzdaɣn tasmirit tamattayt` | 8,910 |
153
+ | 4 | `imzdaɣn tasmirit tamattayt n usɣiws` | 8,910 |
154
+ | 5 | `ilkm umḍan n imzdaɣn nns` | 8,904 |
155
+
156
+ **2-grams (Subword):**
157
+
158
+ | Rank | N-gram | Count |
159
+ |------|--------|-------|
160
+ | 1 | `n _` | 653,950 |
161
+ | 2 | `_ n` | 401,960 |
162
+ | 3 | `_ t` | 358,450 |
163
+ | 4 | `_ i` | 253,361 |
164
+ | 5 | `t a` | 205,185 |
165
+
166
+ **3-grams (Subword):**
167
+
168
+ | Rank | N-gram | Count |
169
+ |------|--------|-------|
170
+ | 1 | `_ n _` | 294,525 |
171
+ | 2 | `_ t a` | 132,562 |
172
+ | 3 | `n _ t` | 104,642 |
173
+ | 4 | `a n _` | 103,515 |
174
+ | 5 | `_ ɣ _` | 101,882 |
175
+
176
+ **4-grams (Subword):**
177
+
178
+ | Rank | N-gram | Count |
179
+ |------|--------|-------|
180
+ | 1 | `_ n _ u` | 84,436 |
181
+ | 2 | `t _ n _` | 67,385 |
182
+ | 3 | `_ n _ i` | 61,498 |
183
+ | 4 | `_ n _ t` | 56,134 |
184
+ | 5 | `n _ u s` | 52,239 |
185
+
186
+ **5-grams (Subword):**
187
+
188
+ | Rank | N-gram | Count |
189
+ |------|--------|-------|
190
+ | 1 | `_ n _ u s` | 51,413 |
191
+ | 2 | `m z d a ɣ` | 46,710 |
192
+ | 3 | `g g ʷ a s` | 34,963 |
193
+ | 4 | `s g g ʷ a` | 34,938 |
194
+ | 5 | `_ n n a _` | 34,315 |
195
+
196
+
197
+ ### Key Findings
198
+
199
+ - **Best Perplexity:** 2-gram (subword) with 255
200
+ - **Entropy Trend:** Decreases with larger n-grams (more predictable)
201
+ - **Coverage:** Top-1000 patterns cover ~68% 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.6330 | 1.551 | 4.06 | 76,272 | 36.7% |
218
+ | **1** | Subword | 1.2927 | 2.450 | 10.38 | 804 | 0.0% |
219
+ | **2** | Word | 0.2598 | 1.197 | 1.65 | 308,953 | 74.0% |
220
+ | **2** | Subword | 1.0716 | 2.102 | 6.52 | 8,341 | 0.0% |
221
+ | **3** | Word | 0.0840 | 1.060 | 1.19 | 508,729 | 91.6% |
222
+ | **3** | Subword | 0.8300 | 1.778 | 3.82 | 54,358 | 17.0% |
223
+ | **4** | Word | 0.0475 🏆 | 1.033 | 1.13 | 601,513 | 95.2% |
224
+ | **4** | Subword | 0.5642 | 1.479 | 2.43 | 207,789 | 43.6% |
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. `n twtmin ɣ tsga n lfṛaṛḥa nna mi ilkm umḍan n ayt ɛli n tarskkilt 43`
233
+ 2. `ɣ tmnaḍt n urtzaɣ taḍwwaṛḍt n tarwuri 2 aslmd g tlkm tgmiḍi n ism n isrɣinn`
234
+ 3. `d ublulls dar gr d lli tmmal tflwit yaḍn ngr adrar n bni matar m sidi`
235
+
236
+ **Context Size 2:**
237
+
238
+ 1. `tgmiḍi n tarskkilt 70 82 gr mddn nna dar gr 6 d 11 n usggʷas niɣ uggar`
239
+ 2. `n usggʷas 28 48 dar tsdnan 3 5 aslmd g tlkm tgmiḍi n 35 1 ig unammas`
240
+ 3. `umḍan n imzdaɣn n lmɣrib ɣ tsga n trudant n fas amknas ɣ lmɣrib iḍfaṛ uḍwwaṛ ad`
241
+
242
+ **Context Size 3:**
243
+
244
+ 1. `tlkm tgmiḍi n uslmd 91 97 gr irban d trbatin nna dar gr 6 d 11 n usggʷas`
245
+ 2. `tamattayt n usɣiws aṛcif 14 ɣuct tisnaddadin tisnaddadin timatayin iggʷiz umḍan n imzdaɣn n tamyawas...`
246
+ 3. `tasmirit tamattayt n usɣiws tisaɣulin isɣwan yaḍnin tasmirit tamattayt n usɣiws ɣ iga umḍan n imawaḍ...`
247
+
248
+ **Context Size 4:**
249
+
250
+ 1. `tasmirit tamattayt n usɣiws aṛcif 14 ɣuct tisnaddadin tisnaddadin timatayin iɣli umḍan n imzdaɣn n a...`
251
+ 2. `g tlkm tgmiḍi n uslmd 98 7 gr irban d trbatin nna dar gr 6 d 11 n usggʷas`
252
+ 3. `ad i trfiqt n ifrdaw tiɣanimin nna ɣ llan 20 n iḍuṛan ilkm umḍan n imzdaɣn nns 997 n`
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. `_sgmawimda_tabir`
262
+ 2. `an_4422._uwafarg`
263
+ 3. `n),_nartan_49_an`
264
+
265
+ **Context Size 2:**
266
+
267
+ 1. `n_des_ig_twuṭṭa_u`
268
+ 2. `_n_10.09_n_uḍwwaṛ`
269
+ 3. `_tɛṛanbattamaslmd`
270
+
271
+ **Context Size 3:**
272
+
273
+ 1. `_n_umḍan_d_imir_an`
274
+ 2. `_tamatay_n_i_tugt_`
275
+ 3. `n_tznit_taru_260_n`
276
+
277
+ **Context Size 4:**
278
+
279
+ 1. `_n_umzdaɣn_tasga_n_`
280
+ 2. `t_n_ayt_baha_ɣ_lli_`
281
+ 3. `_n_iɣ_isggʷasn_d_tr`
282
+
283
+
284
+ ### Key Findings
285
+
286
+ - **Best Predictability:** Context-4 (word) with 95.2% predictability
287
+ - **Branching Factor:** Decreases with context size (more deterministic)
288
+ - **Memory Trade-off:** Larger contexts require more storage (207,789 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 | 31,623 |
305
+ | Total Tokens | 2,378,986 |
306
+ | Mean Frequency | 75.23 |
307
+ | Median Frequency | 4 |
308
+ | Frequency Std Dev | 1969.53 |
309
+
310
+ ### Most Common Words
311
+
312
+ | Rank | Word | Frequency |
313
+ |------|------|-----------|
314
+ | 1 | n | 294,723 |
315
+ | 2 | ɣ | 102,005 |
316
+ | 3 | d | 64,397 |
317
+ | 4 | s | 35,003 |
318
+ | 5 | nna | 34,361 |
319
+ | 6 | imzdaɣn | 31,398 |
320
+ | 7 | dar | 30,865 |
321
+ | 8 | gr | 30,722 |
322
+ | 9 | tgmiḍi | 30,050 |
323
+ | 10 | usggʷas | 28,210 |
324
+
325
+ ### Least Common Words (from vocabulary)
326
+
327
+ | Rank | Word | Frequency |
328
+ |------|------|-----------|
329
+ | 1 | tdarwinit | 2 |
330
+ | 2 | talmuqqdimt | 2 |
331
+ | 3 | ttawnn | 2 |
332
+ | 4 | taggrgist | 2 |
333
+ | 5 | umdgar | 2 |
334
+ | 6 | uqṛiḍ | 2 |
335
+ | 7 | dearborn | 2 |
336
+ | 8 | ghosts | 2 |
337
+ | 9 | tremblay | 2 |
338
+ | 10 | tmmndl | 2 |
339
+
340
+ ### Zipf's Law Analysis
341
+
342
+ | Metric | Value |
343
+ |--------|-------|
344
+ | Zipf Coefficient | 1.2850 |
345
+ | R² (Goodness of Fit) | 0.988028 |
346
+ | Adherence Quality | **excellent** |
347
+
348
+ ### Coverage Analysis
349
+
350
+ | Top N Words | Coverage |
351
+ |-------------|----------|
352
+ | Top 100 | 69.6% |
353
+ | Top 1,000 | 90.6% |
354
+ | Top 5,000 | 95.5% |
355
+ | Top 10,000 | 97.3% |
356
+
357
+ ### Key Findings
358
+
359
+ - **Zipf Compliance:** R²=0.9880 indicates excellent adherence to Zipf's law
360
+ - **High Frequency Dominance:** Top 100 words cover 69.6% of corpus
361
+ - **Long Tail:** 21,623 words needed for remaining 2.7% 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
+ ![Alignment Quality](visualizations/embedding_alignment_quality.png)
378
+
379
+ ![Multilingual t-SNE](visualizations/embedding_tsne_multilingual.png)
380
+
381
+
382
+ ### 5.2 Model Comparison
383
+
384
+ | Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
385
+ |-------|-----------|----------|------------------|---------------|----------------|
386
+ | **mono_32d** | 32 | 0.6948 | 0.3782 | N/A | N/A |
387
+ | **mono_64d** | 64 | 0.5226 | 0.3533 | N/A | N/A |
388
+ | **mono_128d** | 128 | 0.2352 | 0.3437 | N/A | N/A |
389
+ | **aligned_32d** | 32 | 0.6948 🏆 | 0.3868 | 0.0060 | 0.0540 |
390
+ | **aligned_64d** | 64 | 0.5226 | 0.3472 | 0.0240 | 0.1280 |
391
+ | **aligned_128d** | 128 | 0.2352 | 0.3345 | 0.0360 | 0.1780 |
392
+
393
+ ### Key Findings
394
+
395
+ - **Best Isotropy:** aligned_32d with 0.6948 (more uniform distribution)
396
+ - **Semantic Density:** Average pairwise similarity of 0.3573. Lower values indicate better semantic separation.
397
+ - **Alignment Quality:** Aligned models achieve up to 3.6% R@1 in cross-lingual retrieval.
398
+ - **Recommendation:** 128d aligned for best cross-lingual performance
399
+
400
+ ---
401
+ ## 6. Morphological Analysis (Experimental)
402
+
403
+ 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.
404
+
405
+ ### 6.1 Productivity & Complexity
406
+
407
+ | Metric | Value | Interpretation | Recommendation |
408
+ |--------|-------|----------------|----------------|
409
+ | Productivity Index | **5.000** | High morphological productivity | Reliable analysis |
410
+ | Idiomaticity Gap | **-0.041** | Low formulaic content | - |
411
+
412
+ ### 6.2 Affix Inventory (Productive Units)
413
+
414
+ 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.
415
+
416
+ #### Productive Prefixes
417
+ | Prefix | Examples |
418
+ |--------|----------|
419
+ | `-t` | tmurrant, taɣwwaɣt, tuwuri |
420
+ | `-i` | ill, itturray, iɛisayn |
421
+ | `-ta` | taɣwwaɣt, tagnsant, tabrruct |
422
+ | `-a` | anmmassu, asaki, atayn |
423
+ | `-u` | umzizwr, uɣnja, umdlu |
424
+ | `-l` | lmuddn, lmɣrib, lbadiɛ |
425
+ | `-ti` | timqqit, tisutam, tinglizt |
426
+ | `-m` | mggrn, mennawt, magẓnt |
427
+
428
+ #### Productive Suffixes
429
+ | Suffix | Examples |
430
+ |--------|----------|
431
+ | `-n` | atayn, mggrn, krnun |
432
+ | `-t` | tmurrant, priest, taɣwwaɣt |
433
+ | `-a` | uɣnja, phoenicia, iɣrruba |
434
+ | `-in` | ɛalawiyyin, bdrnin, irwin |
435
+ | `-s` | ghosts, yuns, palmas |
436
+ | `-i` | asaki, bani, tuwuri |
437
+ | `-e` | became, institute, neige |
438
+ | `-an` | dan, ubrkan, uljmɛan |
439
+
440
+ ### 6.3 Bound Stems (Lexical Roots)
441
+
442
+ 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.
443
+
444
+ | Stem | Cohesion | Substitutability | Examples |
445
+ |------|----------|------------------|----------|
446
+ | `adda` | 1.68x | 52 contexts | addan, hadda, wadda |
447
+ | `ggar` | 1.97x | 22 contexts | uggar, ggarn, iggar |
448
+ | `ggʷa` | 1.62x | 43 contexts | ḥggʷa, aggʷa, zggʷar |
449
+ | `ugga` | 1.91x | 21 contexts | uggar, uggan, tugga |
450
+ | `wuri` | 1.70x | 30 contexts | twuri, tuwuri, twwuri |
451
+ | `tion` | 2.05x | 14 contexts | nation, notion, action |
452
+ | `matt` | 1.64x | 26 contexts | matta, nmatti, amattu |
453
+ | `lati` | 1.61x | 27 contexts | latif, latin, talati |
454
+ | `ɣrib` | 1.76x | 20 contexts | aɣrib, mɣrib, lmɣrib |
455
+ | `mɣri` | 1.77x | 13 contexts | tmɣri, imɣri, mɣrib |
456
+ | `ddad` | 1.62x | 14 contexts | ḥddad, addad, addadn |
457
+ | `mata` | 1.54x | 14 contexts | smata, amata, umata |
458
+
459
+ ### 6.4 Affix Compatibility (Co-occurrence)
460
+
461
+ This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
462
+
463
+ | Prefix | Suffix | Frequency | Examples |
464
+ |--------|--------|-----------|----------|
465
+ | `-t` | `-t` | 636 words | takrrayt, tusnaktant |
466
+ | `-i` | `-n` | 489 words | ittajjan, igatn |
467
+ | `-t` | `-n` | 323 words | tunisian, tmttawin |
468
+ | `-t` | `-in` | 264 words | tmttawin, tmdinin |
469
+ | `-l` | `-a` | 101 words | lqliɛa, lɛmaṛa |
470
+ | `-t` | `-a` | 71 words | tggʷra, tawayya |
471
+ | `-i` | `-an` | 60 words | ittajjan, ixxan |
472
+ | `-a` | `-n` | 60 words | aẓuran, ayncṭayn |
473
+ | `-l` | `-t` | 39 words | lmɛiṭat, luṭilat |
474
+ | `-a` | `-an` | 39 words | aẓuran, alilan |
475
+
476
+ ### 6.5 Recursive Morpheme Segmentation
477
+
478
+ Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).
479
+
480
+ | Word | Suggested Split | Confidence | Stem |
481
+ |------|-----------------|------------|------|
482
+ | magrebini | **`magreb-in-i`** | 7.5 | `in` |
483
+ | mzaraynin | **`mzaray-n-in`** | 7.5 | `n` |
484
+ | imaynutnin | **`imaynut-n-in`** | 7.5 | `n` |
485
+ | tiɣrmanin | **`tiɣrm-an-in`** | 7.5 | `an` |
486
+ | ikkattinn | **`ikkatt-in-n`** | 7.5 | `in` |
487
+ | tisntutin | **`tisntu-t-in`** | 7.5 | `t` |
488
+ | tasnmḍant | **`tasnmḍ-an-t`** | 7.5 | `an` |
489
+ | tuɣnijinin | **`tuɣnij-in-in`** | 7.5 | `in` |
490
+ | ittyawnna | **`ittyaw-n-na`** | 7.5 | `n` |
491
+ | tinidlisn | **`t-in-idlisn`** | 7.5 | `idlisn` |
492
+ | fransisku | **`fransis-k-u`** | 7.5 | `k` |
493
+ | gibraltar | **`gibral-t-ar`** | 7.5 | `t` |
494
+ | iblḥsanin | **`iblḥsa-n-in`** | 7.5 | `n` |
495
+ | ittyurnan | **`ittyur-n-an`** | 7.5 | `n` |
496
+ | africaines | **`africa-in-es`** | 7.5 | `in` |
497
+
498
+ ### 6.6 Linguistic Interpretation
499
+
500
+ > **Automated Insight:**
501
+ The language Tachelhit shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
502
+
503
+ ---
504
+ ## 7. Summary & Recommendations
505
+
506
+ ![Performance Dashboard](visualizations/performance_dashboard.png)
507
+
508
+ ### Production Recommendations
509
+
510
+ | Component | Recommended | Rationale |
511
+ |-----------|-------------|-----------|
512
+ | Tokenizer | **64k BPE** | Best compression (3.82x) |
513
+ | N-gram | **2-gram** | Lowest perplexity (255) |
514
+ | Markov | **Context-4** | Highest predictability (95.2%) |
515
+ | Embeddings | **100d** | Balanced semantic capture and isotropy |
516
+
517
+
518
+ ---
519
+ ## Appendix: Metrics Glossary & Interpretation Guide
520
+
521
+ This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
522
+
523
+ ### Tokenizer Metrics
524
+
525
+ **Compression Ratio**
526
+ > *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
527
+ >
528
+ > *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.
529
+ >
530
+ > *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
531
+
532
+ **Average Token Length (Fertility)**
533
+ > *Definition:* Mean number of characters per token produced by the tokenizer.
534
+ >
535
+ > *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.
536
+ >
537
+ > *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
538
+
539
+ **Unknown Token Rate (OOV Rate)**
540
+ > *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
541
+ >
542
+ > *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
543
+ >
544
+ > *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
545
+
546
+ ### N-gram Model Metrics
547
+
548
+ **Perplexity**
549
+ > *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
550
+ >
551
+ > *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.
552
+ >
553
+ > *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
554
+
555
+ **Entropy**
556
+ > *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
557
+ >
558
+ > *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
559
+ >
560
+ > *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
561
+
562
+ **Coverage (Top-K)**
563
+ > *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.
564
+ >
565
+ > *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
566
+ >
567
+ > *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
568
+
569
+ ### Markov Chain Metrics
570
+
571
+ **Average Entropy**
572
+ > *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
573
+ >
574
+ > *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).
575
+ >
576
+ > *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
577
+
578
+ **Branching Factor**
579
+ > *Definition:* Average number of unique next tokens observed for each context.
580
+ >
581
+ > *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
582
+ >
583
+ > *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
584
+
585
+ **Predictability**
586
+ > *Definition:* Derived metric: (1 - normalized_entropy) × 100%. Indicates how deterministic the model's predictions are.
587
+ >
588
+ > *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
589
+ >
590
+ > *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
591
+
592
+ ### Vocabulary & Zipf's Law Metrics
593
+
594
+ **Zipf's Coefficient**
595
+ > *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
596
+ >
597
+ > *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
598
+ >
599
+ > *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
600
+
601
+ **R² (Coefficient of Determination)**
602
+ > *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
603
+ >
604
+ > *Intuition:* R² near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
605
+ >
606
+ > *What to seek:* R² > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
607
+
608
+ **Vocabulary Coverage**
609
+ > *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.
610
+ >
611
+ > *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
612
+ >
613
+ > *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
614
+
615
+ ### Word Embedding Metrics
616
+
617
+ **Isotropy**
618
+ > *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
619
+ >
620
+ > *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
621
+ >
622
+ > *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.
623
+
624
+ **Average Norm**
625
+ > *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.
626
+ >
627
+ > *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
628
+ >
629
+ > *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
630
+
631
+ **Cosine Similarity**
632
+ > *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
633
+ >
634
+ > *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
635
+ >
636
+ > *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
637
+
638
+ **t-SNE Visualization**
639
+ > *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
640
+ >
641
+ > *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
642
+ >
643
+ > *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
644
+
645
+ ### General Interpretation Guidelines
646
+
647
+ 1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
648
+ 2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
649
+ 3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
650
+ 4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
651
+ 5. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
652
+
653
+
654
+ ### Visualizations Index
655
+
656
+ | Visualization | Description |
657
+ |---------------|-------------|
658
+ | Tokenizer Compression | Compression ratios by vocabulary size |
659
+ | Tokenizer Fertility | Average token length by vocabulary |
660
+ | Tokenizer OOV | Unknown token rates |
661
+ | Tokenizer Total Tokens | Total tokens by vocabulary |
662
+ | N-gram Perplexity | Perplexity by n-gram size |
663
+ | N-gram Entropy | Entropy by n-gram size |
664
+ | N-gram Coverage | Top pattern coverage |
665
+ | N-gram Unique | Unique n-gram counts |
666
+ | Markov Entropy | Entropy by context size |
667
+ | Markov Branching | Branching factor by context |
668
+ | Markov Contexts | Unique context counts |
669
+ | Zipf's Law | Frequency-rank distribution with fit |
670
+ | Vocab Frequency | Word frequency distribution |
671
+ | Top 20 Words | Most frequent words |
672
+ | Vocab Coverage | Cumulative coverage curve |
673
+ | Embedding Isotropy | Vector space uniformity |
674
+ | Embedding Norms | Vector magnitude distribution |
675
+ | Embedding Similarity | Word similarity heatmap |
676
+ | Nearest Neighbors | Similar words for key terms |
677
+ | t-SNE Words | 2D word embedding visualization |
678
+ | t-SNE Sentences | 2D sentence embedding visualization |
679
+ | Position Encoding | Encoding method comparison |
680
+ | Model Sizes | Storage requirements |
681
+ | Performance Dashboard | Comprehensive performance overview |
682
+
683
+ ---
684
+ 👈 [Back to README](README.md)
685
+
686
+ *Generated by Wikilangs Pipeline · 2026-03-02 12:00:43*
models/embeddings/aligned/shi_128d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5180c0aea685af906cddd6c7f78d295251ff71d075389889cbfaca179459d97d
3
- size 1041689156
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43f1f49436ae92b235449641d5ca8a09092a5b10bb27be36dd23f4e928d75ed2
3
+ size 1041700607
models/embeddings/aligned/shi_128d.projection.npy CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:211531ea12a8ff3821d927f750a97d85b2423306e1fdfa1562cf211f382f3430
3
  size 65664
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4cde5d426b37eed3fc36f35779a7f5d7747bbac7c622b1b0c8dac9abf2566db
3
  size 65664
models/embeddings/aligned/shi_128d_metadata.json CHANGED
@@ -3,6 +3,6 @@
3
  "dimension": 128,
4
  "version": "aligned",
5
  "hub_language": "en",
6
- "seed_vocab_size": 4523,
7
- "vocab_size": 17009
8
  }
 
3
  "dimension": 128,
4
  "version": "aligned",
5
  "hub_language": "en",
6
+ "seed_vocab_size": 4520,
7
+ "vocab_size": 17020
8
  }
models/embeddings/aligned/shi_32d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e4451f5a13fa057c50ce53cba54ab91900310da2c07c02d2c2368d9125262b4a
3
- size 260626244
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8cfecd35338c94847992377475ab7c9f94676c0ea3fc71a13cafdfdd52d47cf
3
+ size 260629247
models/embeddings/aligned/shi_32d.projection.npy CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a8ce5fe0b0b2c491a3310da67bdd0a76624779c9125a008e80bdd50e35e3b43
3
  size 4224
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5d7af1086a96ecbb466e8b2dde410e31bf8771261fbb0872b1fac385f32fe5f
3
  size 4224
models/embeddings/aligned/shi_32d_metadata.json CHANGED
@@ -3,6 +3,6 @@
3
  "dimension": 32,
4
  "version": "aligned",
5
  "hub_language": "en",
6
- "seed_vocab_size": 4523,
7
- "vocab_size": 17009
8
  }
 
3
  "dimension": 32,
4
  "version": "aligned",
5
  "hub_language": "en",
6
+ "seed_vocab_size": 4520,
7
+ "vocab_size": 17020
8
  }
models/embeddings/aligned/shi_64d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:025ce2122ab99474ed6412bca9b451b0bdb3a7f03c5a46ae06f008b0a4d12955
3
- size 520980548
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a25dfe597a349af0cdd94e9615d327c26fbbdb6a8bd88d283c5a9a9b0c29c052
3
+ size 520986367
models/embeddings/aligned/shi_64d.projection.npy CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:abdb81967fc19addd955605ef7f52d5cee989de32bc0f340a6d9a695222a7329
3
  size 16512
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4bb82ee32094a7637efe4c90a00cc7c67176e37d61f0ba6681df1a06068ef7f
3
  size 16512
models/embeddings/aligned/shi_64d_metadata.json CHANGED
@@ -3,6 +3,6 @@
3
  "dimension": 64,
4
  "version": "aligned",
5
  "hub_language": "en",
6
- "seed_vocab_size": 4523,
7
- "vocab_size": 17009
8
  }
 
3
  "dimension": 64,
4
  "version": "aligned",
5
  "hub_language": "en",
6
+ "seed_vocab_size": 4520,
7
+ "vocab_size": 17020
8
  }
models/embeddings/monolingual/shi_128d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5180c0aea685af906cddd6c7f78d295251ff71d075389889cbfaca179459d97d
3
- size 1041689156
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43f1f49436ae92b235449641d5ca8a09092a5b10bb27be36dd23f4e928d75ed2
3
+ size 1041700607
models/embeddings/monolingual/shi_128d_metadata.json CHANGED
@@ -10,7 +10,7 @@
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 128,
13
- "threads": 5
14
  },
15
- "vocab_size": 17009
16
  }
 
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 128,
13
+ "threads": 40
14
  },
15
+ "vocab_size": 17020
16
  }
models/embeddings/monolingual/shi_32d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e4451f5a13fa057c50ce53cba54ab91900310da2c07c02d2c2368d9125262b4a
3
- size 260626244
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8cfecd35338c94847992377475ab7c9f94676c0ea3fc71a13cafdfdd52d47cf
3
+ size 260629247
models/embeddings/monolingual/shi_32d_metadata.json CHANGED
@@ -10,7 +10,7 @@
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 32,
13
- "threads": 5
14
  },
15
- "vocab_size": 17009
16
  }
 
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 32,
13
+ "threads": 40
14
  },
15
+ "vocab_size": 17020
16
  }
models/embeddings/monolingual/shi_64d.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:025ce2122ab99474ed6412bca9b451b0bdb3a7f03c5a46ae06f008b0a4d12955
3
- size 520980548
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a25dfe597a349af0cdd94e9615d327c26fbbdb6a8bd88d283c5a9a9b0c29c052
3
+ size 520986367
models/embeddings/monolingual/shi_64d_metadata.json CHANGED
@@ -10,7 +10,7 @@
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 64,
13
- "threads": 5
14
  },
15
- "vocab_size": 17009
16
  }
 
10
  "epochs": 5,
11
  "encoding_method": "rope",
12
  "dim": 64,
13
+ "threads": 40
14
  },
15
+ "vocab_size": 17020
16
  }
models/subword_markov/shi_markov_ctx1_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:965ea27e92e79f7c9fd28a1a56317eacd35ef7c8b8cf063aec63347b3487811e
3
- size 69971
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ab5b6e6ac56df19fd3d56842b69a627e0a7405220c1c3eac0d438a28a494fde
3
+ size 67897
models/subword_markov/shi_markov_ctx1_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 1,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_contexts": 803,
6
- "total_transitions": 12293493
7
  }
 
2
  "context_size": 1,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_contexts": 804,
6
+ "total_transitions": 12295406
7
  }
models/subword_markov/shi_markov_ctx2_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:92cbe593aca2b2220d718c5ea3130f8a3d5f641e75cc72d54c6c3314ac3fcb8b
3
- size 431239
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1a82548e589b92588b7ab34f6128cb60ca928c17fed55f4859fd13e4bf9a1aa
3
+ size 436486
models/subword_markov/shi_markov_ctx2_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 2,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_contexts": 8338,
6
- "total_transitions": 12282565
7
  }
 
2
  "context_size": 2,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_contexts": 8341,
6
+ "total_transitions": 12284478
7
  }
models/subword_markov/shi_markov_ctx3_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5673b994a73e3cada02d54601e98214c2f8b0812e5d2115fc3103ddb4faac86f
3
- size 1570124
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3955386ff8b4c1aac6b7782eaad8ba2c65c8e45781ae53802d651a9d77c50ee
3
+ size 1577233
models/subword_markov/shi_markov_ctx3_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 3,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_contexts": 54347,
6
- "total_transitions": 12271637
7
  }
 
2
  "context_size": 3,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_contexts": 54358,
6
+ "total_transitions": 12273550
7
  }
models/subword_markov/shi_markov_ctx4_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:10caedfe683a0bebf723f8cf63c4075858f95ab8a974dcd83d66de06ad06f152
3
- size 4216173
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54c93f72e85ee610ce4794367342b4695d74e6b1151660668cf8e91d116ab64f
3
+ size 4179316
models/subword_markov/shi_markov_ctx4_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 4,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_contexts": 207735,
6
- "total_transitions": 12260709
7
  }
 
2
  "context_size": 4,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_contexts": 207789,
6
+ "total_transitions": 12262622
7
  }
models/subword_ngram/shi_2gram_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:264a2d107c0b01701792c13347869860c493b7f303e30529e9862b869d5dfb1f
3
- size 53113
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:920be97eae2f72d66a70f66a47c0fbc6010e6353cd8443ec2e1879b4ab9f08c8
3
+ size 51711
models/subword_ngram/shi_2gram_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "n": 2,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_ngrams": 3781,
6
- "total_ngrams": 12293493
7
  }
 
2
  "n": 2,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_ngrams": 3782,
6
+ "total_ngrams": 12295406
7
  }
models/subword_ngram/shi_3gram_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:98c76510d57a43bdf2439de67e8e6f8f2cf73322dc1873edbdd04abf2229fa64
3
- size 373157
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f51efe7dd30b56c5a847d8eb18e3f5926c058ede9a3b84113d23558b1dff8f5d
3
+ size 371866
models/subword_ngram/shi_3gram_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "n": 3,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_ngrams": 29091,
6
- "total_ngrams": 12282565
7
  }
 
2
  "n": 3,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_ngrams": 29101,
6
+ "total_ngrams": 12284478
7
  }
models/subword_ngram/shi_4gram_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2ec66bc60651234ac0c7f486dbb8911f5660d92a9712705cbec166218b12ccf0
3
- size 1395732
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ece392c150db5e41042b1f1463131a384716098853e47907f14a05bcce3cea56
3
+ size 1385345
models/subword_ngram/shi_4gram_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "n": 4,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_ngrams": 117787,
6
- "total_ngrams": 12271637
7
  }
 
2
  "n": 4,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_ngrams": 117821,
6
+ "total_ngrams": 12273550
7
  }
models/subword_ngram/shi_5gram_subword.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c2d2e731209c07771e78cd8f123affb87ad6fad22719f14da00433985438e7cb
3
- size 2843510
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b593a4e2a22f872f1b914cae01b5d194054be484613f24e2807e6819506df10
3
+ size 2864409
models/subword_ngram/shi_5gram_subword_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "n": 5,
3
  "variant": "subword",
4
  "language": "shi",
5
- "unique_ngrams": 238802,
6
- "total_ngrams": 12260709
7
  }
 
2
  "n": 5,
3
  "variant": "subword",
4
  "language": "shi",
5
+ "unique_ngrams": 238898,
6
+ "total_ngrams": 12262622
7
  }
models/tokenizer/shi_tokenizer_16k.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bf55f93a5c168c699ea7b6920d0c1dce79dad5ed2ec6f0883f5334b8eaf01faf
3
- size 504034
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dea6c7b9bf128d7b9b3ad53e1f56f5d19cb4070b69daab29ff97cbd7915e176e
3
+ size 503979
models/tokenizer/shi_tokenizer_16k.vocab CHANGED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/shi_tokenizer_32k.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:95e152c6683730a7aaa3b25d2d05e5cdcea432d4e701868a0f437eaba784c3c3
3
- size 776917
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d45b96c86ae6e602649478ea13f05b3a0d80e2f383f38743a99288ffa460642f
3
+ size 776921
models/tokenizer/shi_tokenizer_32k.vocab CHANGED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/shi_tokenizer_64k.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:35d7cf73a1c5fa600c08b521908e695a23b70a8a247c9ce00bce001b99605e2a
3
- size 1372695
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:337be644a11642d83988dd942335c62600744f149225c6df3298d487fe9c2c2b
3
+ size 1372696
models/tokenizer/shi_tokenizer_64k.vocab CHANGED
The diff for this file is too large to render. See raw diff
 
models/tokenizer/shi_tokenizer_8k.model CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:12f10cfa65935d01c6f35027ff53d1eba0c95648fa8e5dc24ae25a0c155b0b1b
3
- size 371147
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2262014ef46938da292640461b5504105bb3a1d09d889c2fbb4b5c0f5601f266
3
+ size 371126
models/tokenizer/shi_tokenizer_8k.vocab CHANGED
The diff for this file is too large to render. See raw diff
 
models/vocabulary/shi_vocabulary.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8aa16b4ff5792ecc72682c80a38b44f25d7eae7c4e7a1a61f10f57f8795f9e12
3
- size 528736
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cb46834f112c721e7d30eb95f6399832acb10c559bad1ec9a71ca3b444b73c0
3
+ size 527429
models/vocabulary/shi_vocabulary_metadata.json CHANGED
@@ -1,17 +1,17 @@
1
  {
2
  "language": "shi",
3
- "vocabulary_size": 31610,
4
  "variant": "full",
5
  "statistics": {
6
- "type_token_ratio": 0.031469987327161844,
7
  "coverage": {
8
- "top_100": 0.6830915617715233,
9
- "top_1000": 0.8892152125227943,
10
- "top_5000": 0.9379014423761386,
11
- "top_10000": 0.9550817833419236
12
  },
13
- "hapax_count": 44651,
14
- "hapax_ratio": 0.5855024193231141,
15
  "total_documents": 10928
16
  }
17
  }
 
1
  {
2
  "language": "shi",
3
+ "vocabulary_size": 31623,
4
  "variant": "full",
5
  "statistics": {
6
+ "type_token_ratio": 0.031480475198470415,
7
  "coverage": {
8
+ "top_100": 0.6830340546800894,
9
+ "top_1000": 0.8891742698339413,
10
+ "top_5000": 0.9378737372924679,
11
+ "top_10000": 0.9550576586412044
12
  },
13
+ "hapax_count": 44675,
14
+ "hapax_ratio": 0.5855330414951899,
15
  "total_documents": 10928
16
  }
17
  }
models/word_markov/shi_markov_ctx1_word.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a960641178f1c734df546734d77f572b5824eea890e57f5b33664ee18a1b81ff
3
- size 2594157
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a037b3539cc1a51be346e2090ddbfda4e732441f256bf314ba7eb87ee0ec50a5
3
+ size 2608428
models/word_markov/shi_markov_ctx1_word_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 1,
3
  "variant": "word",
4
  "language": "shi",
5
- "unique_contexts": 76235,
6
- "total_transitions": 2412365
7
  }
 
2
  "context_size": 1,
3
  "variant": "word",
4
  "language": "shi",
5
+ "unique_contexts": 76272,
6
+ "total_transitions": 2412733
7
  }
models/word_markov/shi_markov_ctx2_word.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ca2b881ebda57ee862c4f305d0f27ec4c7e03aeb89cc61d3f40f1fff8de62788
3
- size 5760236
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a43fa252c83eb91d1f6923e27bbbc6e9067265eee7415ea83af7164014be8c11
3
+ size 5736513
models/word_markov/shi_markov_ctx2_word_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 2,
3
  "variant": "word",
4
  "language": "shi",
5
- "unique_contexts": 308778,
6
- "total_transitions": 2401437
7
  }
 
2
  "context_size": 2,
3
  "variant": "word",
4
  "language": "shi",
5
+ "unique_contexts": 308953,
6
+ "total_transitions": 2401805
7
  }
models/word_markov/shi_markov_ctx3_word.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:25ee5eb4f0959a5d169b844d85d2a0f97c439371968c7791593a5b73f29e93dd
3
- size 8170854
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec84c5a2aa31b94c03d73d8303a801f75656c1586c45343c9aabc2db871d3430
3
+ size 8241476
models/word_markov/shi_markov_ctx3_word_metadata.json CHANGED
@@ -2,6 +2,6 @@
2
  "context_size": 3,
3
  "variant": "word",
4
  "language": "shi",
5
- "unique_contexts": 508428,
6
- "total_transitions": 2390509
7
  }
 
2
  "context_size": 3,
3
  "variant": "word",
4
  "language": "shi",
5
+ "unique_contexts": 508729,
6
+ "total_transitions": 2390877
7
  }
models/word_markov/shi_markov_ctx4_word.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:17c766958e099580b89478e9f2f89167c4f22bbe880d222bab71e9521d926882
3
- size 9985346
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95128d1594fb711dcfd8b65380855e86b339a7cbb5ebd05c929b3e239f2d1b08
3
+ size 9975630