szl / README.md
omarkamali's picture
Upload all models and assets for szl (latest)
4792eba verified
---
language: szl
language_name: Silesian
language_family: slavic_west
tags:
- wikilangs
- nlp
- tokenizer
- embeddings
- n-gram
- markov
- wikipedia
- feature-extraction
- sentence-similarity
- tokenization
- n-grams
- markov-chain
- text-mining
- fasttext
- babelvec
- vocabulous
- vocabulary
- monolingual
- family-slavic_west
license: mit
library_name: wikilangs
pipeline_tag: text-generation
datasets:
- omarkamali/wikipedia-monthly
dataset_info:
name: wikipedia-monthly
description: Monthly snapshots of Wikipedia articles across 300+ languages
metrics:
- name: best_compression_ratio
type: compression
value: 3.880
- name: best_isotropy
type: isotropy
value: 0.8517
- name: vocabulary_size
type: vocab
value: 0
generated: 2026-01-11
---
# Silesian - Wikilangs Models
## Comprehensive Research Report & Full Ablation Study
This repository contains NLP models trained and evaluated by Wikilangs, specifically on **Silesian** Wikipedia data.
We analyze tokenizers, n-gram models, Markov chains, vocabulary statistics, and word embeddings.
## ๐Ÿ“‹ Repository Contents
### Models & Assets
- Tokenizers (8k, 16k, 32k, 64k)
- N-gram models (2, 3, 4, 5-gram)
- Markov chains (context of 1, 2, 3, 4 and 5)
- Subword N-gram and Markov chains
- Embeddings in various sizes and dimensions (aligned and unaligned)
- Language Vocabulary
- Language Statistics
![Performance Dashboard](visualizations/performance_dashboard.png)
### Analysis and Evaluation
- [1. Tokenizer Evaluation](#1-tokenizer-evaluation)
- [2. N-gram Model Evaluation](#2-n-gram-model-evaluation)
- [3. Markov Chain Evaluation](#3-markov-chain-evaluation)
- [4. Vocabulary Analysis](#4-vocabulary-analysis)
- [5. Word Embeddings Evaluation](#5-word-embeddings-evaluation)
- [6. Morphological Analysis (Experimental)](#6--morphological-analysis-experimental)
- [7. Summary & Recommendations](#7-summary--recommendations)
- [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide)
- [Visualizations Index](#visualizations-index)
---
## 1. Tokenizer Evaluation
![Tokenizer Compression](visualizations/tokenizer_compression.png)
![Tokenizer Fertility](visualizations/tokenizer_fertility.png)
![Tokenizer OOV](visualizations/tokenizer_oov.png)
![Total Tokens](visualizations/tokenizer_total_tokens.png)
### Results
| Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens |
|------------|-------------|---------------|----------|--------------|
| **8k** | 2.736x | 2.74 | 0.2610% | 366,292 |
| **16k** | 3.082x | 3.09 | 0.2940% | 325,183 |
| **32k** | 3.462x | 3.47 | 0.3302% | 289,489 |
| **64k** | 3.880x ๐Ÿ† | 3.88 | 0.3701% | 258,336 |
### Tokenization Examples
Below are sample sentences tokenized with each vocabulary size:
**Sample 1:** `Antennularia engleriana je grzibDothideomycetes. Crous P.W. et al., ลปลdne podgat...`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–antenn ularia โ–eng leri ana โ–je โ–grzib dothideomycetes . โ–crous ... (+20 more)` | 30 |
| 16k | `โ–antenn ularia โ–eng leri ana โ–je โ–grzib dothideomycetes . โ–crous ... (+20 more)` | 30 |
| 32k | `โ–antenn ularia โ–eng leriana โ–je โ–grzib dothideomycetes . โ–crous โ–p ... (+18 more)` | 28 |
| 64k | `โ–antennularia โ–engleriana โ–je โ–grzib dothideomycetes . โ–crous โ–p . w ... (+15 more)` | 25 |
**Sample 2:** `At-Tall (arab. ุงู„ุชู„) - mjasto we Syryji, we muhafaลบe Damaszek. Syryji`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–at - t all โ–( arab . โ–ุงู„ ุช ู„ ... (+19 more)` | 29 |
| 16k | `โ–at - t all โ–( arab . โ–ุงู„ ุช ู„ ... (+14 more)` | 24 |
| 32k | `โ–at - t all โ–( arab . โ–ุงู„ ุช ู„ ... (+13 more)` | 23 |
| 64k | `โ–at - tall โ–( arab . โ–ุงู„ ุช ู„ ) ... (+10 more)` | 20 |
**Sample 3:** `Niechcice - wjeล› we Polsce, we ล‚ลฏdzkim wojewลฏdztwje, we pjotrkowskim kryล›e, we g...`
| Vocab | Tokens | Count |
|-------|--------|-------|
| 8k | `โ–nie ch ci ce โ–- โ–wjeล› โ–we โ–polsce , โ–we ... (+19 more)` | 29 |
| 16k | `โ–nie ch ci ce โ–- โ–wjeล› โ–we โ–polsce , โ–we ... (+19 more)` | 29 |
| 32k | `โ–nie ch cice โ–- โ–wjeล› โ–we โ–polsce , โ–we โ–ล‚ลฏdzkim ... (+13 more)` | 23 |
| 64k | `โ–niech cice โ–- โ–wjeล› โ–we โ–polsce , โ–we โ–ล‚ลฏdzkim โ–wojewลฏdztwje ... (+10 more)` | 20 |
### Key Findings
- **Best Compression:** 64k achieves 3.880x compression
- **Lowest UNK Rate:** 8k with 0.2610% unknown tokens
- **Trade-off:** Larger vocabularies improve compression but increase model size
- **Recommendation:** 32k vocabulary provides optimal balance for production use
---
## 2. N-gram Model Evaluation
![N-gram Perplexity](visualizations/ngram_perplexity.png)
![N-gram Unique](visualizations/ngram_unique.png)
![N-gram Coverage](visualizations/ngram_coverage.png)
### Results
| N-gram | Variant | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage |
|--------|---------|------------|---------|----------------|------------------|-------------------|
| **2-gram** | Word | 1,665 | 10.70 | 41,244 | 51.6% | 67.0% |
| **2-gram** | Subword | 377 ๐Ÿ† | 8.56 | 4,569 | 56.0% | 98.8% |
| **3-gram** | Word | 2,887 | 11.50 | 71,514 | 45.8% | 60.1% |
| **3-gram** | Subword | 2,569 | 11.33 | 35,586 | 24.6% | 69.8% |
| **4-gram** | Word | 5,905 | 12.53 | 130,516 | 38.7% | 52.4% |
| **4-gram** | Subword | 9,144 | 13.16 | 182,935 | 21.2% | 50.5% |
| **5-gram** | Word | 5,950 | 12.54 | 123,019 | 38.0% | 51.8% |
| **5-gram** | Subword | 19,738 | 14.27 | 474,808 | 20.5% | 45.5% |
### Top 5 N-grams by Size
**2-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `nลleลผy do` | 42,907 |
| 2 | `co go` | 42,145 |
| 3 | `do zorty` | 41,870 |
| 4 | `catalogue of` | 38,396 |
| 5 | `of life` | 37,886 |
**3-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `nลleลผy do zorty` | 41,864 |
| 2 | `catalogue of life` | 37,868 |
| 3 | `wymianowane we catalogue` | 37,821 |
| 4 | `we catalogue of` | 37,821 |
| 5 | `niy sลm wymianowane` | 37,821 |
**4-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `wymianowane we catalogue of` | 37,821 |
| 2 | `podgatลnki niy sลm wymianowane` | 37,821 |
| 3 | `we catalogue of life` | 37,821 |
| 4 | `sลm wymianowane we catalogue` | 37,821 |
| 5 | `niy sลm wymianowane we` | 37,821 |
**5-grams (Word):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `wymianowane we catalogue of life` | 37,821 |
| 2 | `sลm wymianowane we catalogue of` | 37,821 |
| 3 | `niy sลm wymianowane we catalogue` | 37,821 |
| 4 | `podgatลnki niy sลm wymianowane we` | 37,821 |
| 5 | `ลผลdne podgatลnki niy sลm wymianowane` | 37,649 |
**2-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `e _` | 413,277 |
| 2 | `. _` | 295,815 |
| 3 | `a _` | 245,121 |
| 4 | `, _` | 210,014 |
| 5 | `o _` | 204,334 |
**3-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `_ w e` | 97,236 |
| 2 | `w e _` | 96,518 |
| 3 | `j e _` | 94,089 |
| 4 | `n e _` | 83,675 |
| 5 | `_ p o` | 75,494 |
**4-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `_ w e _` | 93,519 |
| 2 | `e _ p o` | 53,403 |
| 3 | `_ j e _` | 49,853 |
| 4 | `_ d o _` | 48,583 |
| 5 | `_ o f _` | 45,397 |
**5-grams (Subword):**
| Rank | N-gram | Count |
|------|--------|-------|
| 1 | `l e ลผ y _` | 43,779 |
| 2 | `n ล l e ลผ` | 43,701 |
| 3 | `y _ d o _` | 43,515 |
| 4 | `ล l e ลผ y` | 43,514 |
| 5 | `_ n ล l e` | 43,467 |
### Key Findings
- **Best Perplexity:** 2-gram (subword) with 377
- **Entropy Trend:** Decreases with larger n-grams (more predictable)
- **Coverage:** Top-1000 patterns cover ~45% of corpus
- **Recommendation:** 4-gram or 5-gram for best predictive performance
---
## 3. Markov Chain Evaluation
![Markov Entropy](visualizations/markov_entropy.png)
![Markov Contexts](visualizations/markov_contexts.png)
![Markov Branching](visualizations/markov_branching.png)
### Results
| Context | Variant | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability |
|---------|---------|-------------|------------|------------------|-----------------|----------------|
| **1** | Word | 0.7246 | 1.652 | 3.77 | 184,519 | 27.5% |
| **1** | Subword | 0.9527 | 1.935 | 6.66 | 2,047 | 4.7% |
| **2** | Word | 0.2321 | 1.175 | 1.49 | 665,117 | 76.8% |
| **2** | Subword | 0.8520 | 1.805 | 5.22 | 13,622 | 14.8% |
| **3** | Word | 0.0643 | 1.046 | 1.17 | 958,540 | 93.6% |
| **3** | Subword | 0.7901 | 1.729 | 4.14 | 71,008 | 21.0% |
| **4** | Word | 0.0556 ๐Ÿ† | 1.039 | 1.14 | 1,084,256 | 94.4% |
| **4** | Subword | 0.6711 | 1.592 | 2.92 | 293,910 | 32.9% |
### Generated Text Samples (Word-based)
Below are text samples generated from each word-based Markov chain model:
**Context Size 1:**
1. `we รดpolskim wojewลdztwie we catalogue of life simulans nลleลผy do cylลw religijnych we xxi stuleฤ‡e xx...`
2. `i familije dermateaceae species fungorum kirk p m ลผลdne podgatลnki niy sลm wymianowane we catalogue ...`
3. `je grzibh sydow in aust j jap ใƒ—ใƒฌใ‚คใ‚นใƒ†ใƒผใ‚ทใƒงใƒณ pureisutฤ“shon surฤซ skrลt ps3 xbox 360 mac ัˆั‚ะธะฟ`
**Context Size 2:**
1. `nลleลผy do zorty candida rzyndu saccharomycetales klasy saccharomycetes grลmady ascomycota i krลlestw...`
2. `co go nojprzลd รดpisoล‚ rolf singer a h sm psathyrella incerta je porost co go รดpisoล‚ leuchtm`
3. `do zorty chytriomyces i familije ophiostomataceae species fungorum kirk p m ลผลdne podgatลnki niy sลm...`
**Context Size 3:**
1. `nลleลผy do zorty tetramelas i familije physciaceae lias a global information system for lichenized an...`
2. `podgatลnki niy sลm wymianowane we catalogue of life foliicola`
3. `sลm wymianowane we catalogue of life papuanus`
**Context Size 4:**
1. `podgatลnki niy sลm wymianowane we catalogue of life minoensis`
2. `wymianowane we catalogue of life nivale`
3. `niy sลm wymianowane we catalogue of life macarangae`
### Generated Text Samples (Subword-based)
Below are text samples generated from each subword-based Markov chain model:
**Context Size 1:**
1. `_je_dym_spลฏn_s._`
2. `erzyneso_pongang`
3. `atewyri_mole_fro`
**Context Size 2:**
1. `e_(cyji,_dogue_op`
2. `._catisciszkulacc`
3. `a_za.w._henije_go`
**Context Size 3:**
1. `_we_cataceae.speci`
2. `we_catalogue_of_ci`
3. `je_catalopara)_โ€“_m`
**Context Size 4:**
1. `_we_รดpolsce,_we_cat`
2. `e_podgatลnki_niy_sล`
3. `_je_grzibp.a._maria`
### Key Findings
- **Best Predictability:** Context-4 (word) with 94.4% predictability
- **Branching Factor:** Decreases with context size (more deterministic)
- **Memory Trade-off:** Larger contexts require more storage (293,910 contexts)
- **Recommendation:** Context-3 or Context-4 for text generation
---
## 4. Vocabulary Analysis
![Zipf's Law](visualizations/zipf_law.png)
![Top Words](visualizations/top20_words.png)
![Coverage Curve](visualizations/vocab_coverage.png)
### Statistics
| Metric | Value |
|--------|-------|
| Vocabulary Size | 92,972 |
| Total Tokens | 2,725,524 |
| Mean Frequency | 29.32 |
| Median Frequency | 3 |
| Frequency Std Dev | 753.54 |
### Most Common Words
| Rank | Word | Frequency |
|------|------|-----------|
| 1 | we | 94,285 |
| 2 | i | 50,989 |
| 3 | je | 50,114 |
| 4 | do | 48,665 |
| 5 | a | 45,622 |
| 6 | of | 45,405 |
| 7 | co | 44,993 |
| 8 | nลleลผy | 43,437 |
| 9 | p | 43,323 |
| 10 | zorty | 42,795 |
### Least Common Words (from vocabulary)
| Rank | Word | Frequency |
|------|------|-----------|
| 1 | luฤani | 2 |
| 2 | reyez | 2 |
| 3 | paderewek | 2 |
| 4 | touraine | 2 |
| 5 | esves | 2 |
| 6 | oussouye | 2 |
| 7 | appanoose | 2 |
| 8 | bielawy | 2 |
| 9 | sentinel | 2 |
| 10 | tetowo | 2 |
### Zipf's Law Analysis
| Metric | Value |
|--------|-------|
| Zipf Coefficient | 1.0230 |
| Rยฒ (Goodness of Fit) | 0.995074 |
| Adherence Quality | **excellent** |
### Coverage Analysis
| Top N Words | Coverage |
|-------------|----------|
| Top 100 | 55.5% |
| Top 1,000 | 71.0% |
| Top 5,000 | 81.7% |
| Top 10,000 | 86.3% |
### Key Findings
- **Zipf Compliance:** Rยฒ=0.9951 indicates excellent adherence to Zipf's law
- **High Frequency Dominance:** Top 100 words cover 55.5% of corpus
- **Long Tail:** 82,972 words needed for remaining 13.7% coverage
---
## 5. Word Embeddings Evaluation
![Embedding Isotropy](visualizations/embedding_isotropy.png)
![Similarity Matrix](visualizations/embedding_similarity.png)
![t-SNE Words](visualizations/tsne_words.png)
![t-SNE Sentences](visualizations/tsne_sentences.png)
### 5.1 Cross-Lingual Alignment
![Alignment Quality](visualizations/embedding_alignment_quality.png)
![Multilingual t-SNE](visualizations/embedding_tsne_multilingual.png)
### 5.2 Model Comparison
| Model | Dimension | Isotropy | Semantic Density | Alignment R@1 | Alignment R@10 |
|-------|-----------|----------|------------------|---------------|----------------|
| **mono_32d** | 32 | 0.8517 | 0.3158 | N/A | N/A |
| **mono_64d** | 64 | 0.7384 | 0.2638 | N/A | N/A |
| **mono_128d** | 128 | 0.3461 | 0.2417 | N/A | N/A |
| **aligned_32d** | 32 | 0.8517 ๐Ÿ† | 0.3088 | 0.0380 | 0.2580 |
| **aligned_64d** | 64 | 0.7384 | 0.2604 | 0.0760 | 0.3540 |
| **aligned_128d** | 128 | 0.3461 | 0.2496 | 0.1240 | 0.4320 |
### Key Findings
- **Best Isotropy:** aligned_32d with 0.8517 (more uniform distribution)
- **Semantic Density:** Average pairwise similarity of 0.2733. Lower values indicate better semantic separation.
- **Alignment Quality:** Aligned models achieve up to 12.4% R@1 in cross-lingual retrieval.
- **Recommendation:** 128d aligned for best cross-lingual performance
---
## 6. Morphological Analysis (Experimental)
This section presents an automated morphological analysis derived from the statistical divergence between word-level and subword-level models. By analyzing where subword predictability spikes and where word-level coverage fails, we can infer linguistic structures without supervised data.
### 6.1 Productivity & Complexity
| Metric | Value | Interpretation | Recommendation |
|--------|-------|----------------|----------------|
| Productivity Index | **5.000** | High morphological productivity | Reliable analysis |
| Idiomaticity Gap | **0.138** | Low formulaic content | - |
### 6.2 Affix Inventory (Productive Units)
These are the most productive prefixes and suffixes identified by sampling the vocabulary for global substitutability patterns. A unit is considered an affix if stripping it leaves a valid stem that appears in other contexts.
#### Productive Prefixes
| Prefix | Examples |
|--------|----------|
| `-s` | szczawno, saccatus, synagodze |
| `-p` | przedmieล›cia, peroxydata, pageant |
| `-b` | bouvet, bottomleyae, brzygach |
| `-m` | mozambicki, melanotaeniaceae, macriytrium |
| `-a` | anulohypha, auriscalpium, apogaeumannomyces |
| `-k` | koksu, kลฏล„cowo, krywczyce |
| `-c` | ceratocephali, canaria, cylindriytridium |
| `-d` | darwin, dลminujลm, dziedzic |
#### Productive Suffixes
| Suffix | Examples |
|--------|----------|
| `-a` | lylea, przedmieล›cia, granulospora |
| `-s` | saccatus, nonfermentans, luteoumbrinus |
| `-e` | fajruje, synagodze, melanotaeniaceae |
| `-m` | dลminujลm, macriytrium, ventricosum |
| `-um` | macriytrium, ventricosum, renatobasidium |
| `-i` | mozambicki, romellii, ceratocephali |
| `-is` | rigensis, montis, andreadis |
| `-la` | subramaniula, chaetomella, hyjdla |
### 6.3 Bound Stems (Lexical Roots)
Bound stems are high-frequency subword units that are semantically cohesive but rarely appear as standalone words. These often correspond to the 'core' of a word that requires inflection or derivation to be valid.
| Stem | Cohesion | Substitutability | Examples |
|------|----------|------------------|----------|
| `anow` | 2.10x | 88 contexts | banowo, banowรต, janowo |
| `grzi` | 2.31x | 52 contexts | grzib, grzibn, grzibj |
| `rzib` | 1.89x | 123 contexts | grzib, grzibn, grzibj |
| `owan` | 2.14x | 55 contexts | cowan, gowan, rowan |
| `omyc` | 2.21x | 37 contexts | ascomyc, oomyces, phomyces |
| `cata` | 2.57x | 18 contexts | catal, catalร , falcata |
| `ilij` | 2.07x | 27 contexts | wilijรต, filije, wilijo |
| `piso` | 2.19x | 21 contexts | pisoล™, pisoล‚, pisorz |
| `acea` | 1.94x | 19 contexts | jaceae, picacea, pinacea |
| `amil` | 1.65x | 24 contexts | kamil, tamil, kamila |
| `wane` | 2.01x | 12 contexts | zwane, dowane, tshwane |
| `iano` | 1.96x | 12 contexts | piano, miano, dianoi |
### 6.4 Affix Compatibility (Co-occurrence)
This table shows which prefixes and suffixes most frequently co-occur on the same stems, revealing the 'stacking' rules of the language's morphology.
| Prefix | Suffix | Frequency | Examples |
|--------|--------|-----------|----------|
| `-p` | `-a` | 176 words | planifunda, pracowoua |
| `-s` | `-a` | 174 words | struna, sล‚upska |
| `-c` | `-a` | 145 words | cordanophora, carinthiaca |
| `-c` | `-s` | 115 words | clypeolarioides, citeromyces |
| `-a` | `-a` | 111 words | austrogautieria, armja |
| `-p` | `-s` | 111 words | proliferans, poliomopsis |
| `-p` | `-e` | 107 words | paxillaceae, poล‚oลผลฏne |
| `-m` | `-a` | 101 words | masuka, manisa |
| `-s` | `-s` | 100 words | spondylocladiopsis, spargens |
| `-p` | `-m` | 100 words | polyrhizum, putaminum |
### 6.5 Recursive Morpheme Segmentation
Using **Recursive Hierarchical Substitutability**, we decompose complex words into their constituent morphemes. This approach handles nested affixes (e.g., `prefix-prefix-root-suffix`).
| Word | Suggested Split | Confidence | Stem |
|------|-----------------|------------|------|
| fajrowany | **`fajrow-a-ny`** | 7.5 | `a` |
| spisowany | **`spisow-a-ny`** | 7.5 | `a` |
| ingeniosa | **`ingenio-s-a`** | 7.5 | `s` |
| abbreviata | **`abbrevi-a-ta`** | 7.5 | `a` |
| houbraken | **`houbrak-e-n`** | 7.5 | `e` |
| ukrainian | **`ukraini-a-n`** | 7.5 | `a` |
| floridana | **`florid-a-na`** | 7.5 | `a` |
| kลmprลmis | **`kลmprล-m-is`** | 7.5 | `m` |
| publikacyjach | **`publikacyj-a-ch`** | 7.5 | `a` |
| afganistan | **`afganist-a-n`** | 7.5 | `a` |
| zdrzลฏduach | **`zdrzลฏdu-a-ch`** | 7.5 | `a` |
| leptospira | **`leptosp-i-ra`** | 7.5 | `i` |
| himalajach | **`himalaj-a-ch`** | 7.5 | `a` |
| kลntaktach | **`kลntakt-a-ch`** | 7.5 | `a` |
| luteonana | **`luteon-a-na`** | 7.5 | `a` |
### 6.6 Linguistic Interpretation
> **Automated Insight:**
The language Silesian shows high morphological productivity. The subword models are significantly more efficient than word models, suggesting a rich system of affixation or compounding.
---
## 7. Summary & Recommendations
![Performance Dashboard](visualizations/performance_dashboard.png)
### Production Recommendations
| Component | Recommended | Rationale |
|-----------|-------------|-----------|
| Tokenizer | **64k BPE** | Best compression (3.88x) |
| N-gram | **2-gram** | Lowest perplexity (377) |
| Markov | **Context-4** | Highest predictability (94.4%) |
| Embeddings | **100d** | Balanced semantic capture and isotropy |
---
## Appendix: Metrics Glossary & Interpretation Guide
This section provides definitions, intuitions, and guidance for interpreting the metrics used throughout this report.
### Tokenizer Metrics
**Compression Ratio**
> *Definition:* The ratio of characters to tokens (chars/token). Measures how efficiently the tokenizer represents text.
>
> *Intuition:* Higher compression means fewer tokens needed to represent the same text, reducing sequence lengths for downstream models. A 3x compression means ~3 characters per token on average.
>
> *What to seek:* Higher is generally better for efficiency, but extremely high compression may indicate overly aggressive merging that loses morphological information.
**Average Token Length (Fertility)**
> *Definition:* Mean number of characters per token produced by the tokenizer.
>
> *Intuition:* Reflects the granularity of tokenization. Longer tokens capture more context but may struggle with rare words; shorter tokens are more flexible but increase sequence length.
>
> *What to seek:* Balance between 2-5 characters for most languages. Arabic/morphologically-rich languages may benefit from slightly longer tokens.
**Unknown Token Rate (OOV Rate)**
> *Definition:* Percentage of tokens that map to the unknown/UNK token, indicating words the tokenizer cannot represent.
>
> *Intuition:* Lower OOV means better vocabulary coverage. High OOV indicates the tokenizer encounters many unseen character sequences.
>
> *What to seek:* Below 1% is excellent; below 5% is acceptable. BPE tokenizers typically achieve very low OOV due to subword fallback.
### N-gram Model Metrics
**Perplexity**
> *Definition:* Measures how "surprised" the model is by test data. Mathematically: 2^(cross-entropy). Lower values indicate better prediction.
>
> *Intuition:* If perplexity is 100, the model is as uncertain as if choosing uniformly among 100 options at each step. A perplexity of 10 means effectively choosing among 10 equally likely options.
>
> *What to seek:* Lower is better. Perplexity decreases with larger n-grams (more context). Values vary widely by language and corpus size.
**Entropy**
> *Definition:* Average information content (in bits) needed to encode the next token given the context. Related to perplexity: perplexity = 2^entropy.
>
> *Intuition:* High entropy means high uncertainty/randomness; low entropy means predictable patterns. Natural language typically has entropy between 1-4 bits per character.
>
> *What to seek:* Lower entropy indicates more predictable text patterns. Entropy should decrease as n-gram size increases.
**Coverage (Top-K)**
> *Definition:* Percentage of corpus occurrences explained by the top K most frequent n-grams.
>
> *Intuition:* High coverage with few patterns indicates repetitive/formulaic text; low coverage suggests diverse vocabulary usage.
>
> *What to seek:* Depends on use case. For language modeling, moderate coverage (40-60% with top-1000) is typical for natural text.
### Markov Chain Metrics
**Average Entropy**
> *Definition:* Mean entropy across all contexts, measuring average uncertainty in next-word prediction.
>
> *Intuition:* Lower entropy means the model is more confident about what comes next. Context-1 has high entropy (many possible next words); Context-4 has low entropy (few likely continuations).
>
> *What to seek:* Decreasing entropy with larger context sizes. Very low entropy (<0.1) indicates highly deterministic transitions.
**Branching Factor**
> *Definition:* Average number of unique next tokens observed for each context.
>
> *Intuition:* High branching = many possible continuations (flexible but uncertain); low branching = few options (predictable but potentially repetitive).
>
> *What to seek:* Branching factor should decrease with context size. Values near 1.0 indicate nearly deterministic chains.
**Predictability**
> *Definition:* Derived metric: (1 - normalized_entropy) ร— 100%. Indicates how deterministic the model's predictions are.
>
> *Intuition:* 100% predictability means the next word is always certain; 0% means completely random. Real text falls between these extremes.
>
> *What to seek:* Higher predictability for text generation quality, but too high (>98%) may produce repetitive output.
### Vocabulary & Zipf's Law Metrics
**Zipf's Coefficient**
> *Definition:* The slope of the log-log plot of word frequency vs. rank. Zipf's law predicts this should be approximately -1.
>
> *Intuition:* A coefficient near -1 indicates the corpus follows natural language patterns where a few words are very common and most words are rare.
>
> *What to seek:* Values between -0.8 and -1.2 indicate healthy natural language distribution. Deviations may suggest domain-specific or artificial text.
**Rยฒ (Coefficient of Determination)**
> *Definition:* Measures how well the linear fit explains the frequency-rank relationship. Ranges from 0 to 1.
>
> *Intuition:* Rยฒ near 1.0 means the data closely follows Zipf's law; lower values indicate deviation from expected word frequency patterns.
>
> *What to seek:* Rยฒ > 0.95 is excellent; > 0.99 indicates near-perfect Zipf adherence typical of large natural corpora.
**Vocabulary Coverage**
> *Definition:* Cumulative percentage of corpus tokens accounted for by the top N words.
>
> *Intuition:* Shows how concentrated word usage is. If top-100 words cover 50% of text, the corpus relies heavily on common words.
>
> *What to seek:* Top-100 covering 30-50% is typical. Higher coverage indicates more repetitive text; lower suggests richer vocabulary.
### Word Embedding Metrics
**Isotropy**
> *Definition:* Measures how uniformly distributed vectors are in the embedding space. Computed as the ratio of minimum to maximum singular values.
>
> *Intuition:* High isotropy (near 1.0) means vectors spread evenly in all directions; low isotropy means vectors cluster in certain directions, reducing expressiveness.
>
> *What to seek:* Higher isotropy generally indicates better-quality embeddings. Values > 0.1 are reasonable; > 0.3 is good. Lower-dimensional embeddings tend to have higher isotropy.
**Average Norm**
> *Definition:* Mean magnitude (L2 norm) of word vectors in the embedding space.
>
> *Intuition:* Indicates the typical "length" of vectors. Consistent norms suggest stable training; high variance may indicate some words are undertrained.
>
> *What to seek:* Relatively consistent norms across models. The absolute value matters less than consistency (low std deviation).
**Cosine Similarity**
> *Definition:* Measures angular similarity between vectors, ranging from -1 (opposite) to 1 (identical direction).
>
> *Intuition:* Words with similar meanings should have high cosine similarity. This is the standard metric for semantic relatedness in embeddings.
>
> *What to seek:* Semantically related words should score > 0.5; unrelated words should be near 0. Synonyms often score > 0.7.
**t-SNE Visualization**
> *Definition:* t-Distributed Stochastic Neighbor Embedding - a dimensionality reduction technique that preserves local structure for visualization.
>
> *Intuition:* Clusters in t-SNE plots indicate groups of semantically related words. Spread indicates vocabulary diversity; tight clusters suggest semantic coherence.
>
> *What to seek:* Meaningful clusters (e.g., numbers together, verbs together). Avoid over-interpreting distances - t-SNE preserves local, not global, structure.
### General Interpretation Guidelines
1. **Compare within model families:** Metrics are most meaningful when comparing models of the same type (e.g., 8k vs 64k tokenizer).
2. **Consider trade-offs:** Better performance on one metric often comes at the cost of another (e.g., compression vs. OOV rate).
3. **Context matters:** Optimal values depend on downstream tasks. Text generation may prioritize different metrics than classification.
4. **Corpus influence:** All metrics are influenced by corpus characteristics. Wikipedia text differs from social media or literature.
5. **Language-specific patterns:** Morphologically rich languages (like Arabic) may show different optimal ranges than analytic languages.
### Visualizations Index
| Visualization | Description |
|---------------|-------------|
| Tokenizer Compression | Compression ratios by vocabulary size |
| Tokenizer Fertility | Average token length by vocabulary |
| Tokenizer OOV | Unknown token rates |
| Tokenizer Total Tokens | Total tokens by vocabulary |
| N-gram Perplexity | Perplexity by n-gram size |
| N-gram Entropy | Entropy by n-gram size |
| N-gram Coverage | Top pattern coverage |
| N-gram Unique | Unique n-gram counts |
| Markov Entropy | Entropy by context size |
| Markov Branching | Branching factor by context |
| Markov Contexts | Unique context counts |
| Zipf's Law | Frequency-rank distribution with fit |
| Vocab Frequency | Word frequency distribution |
| Top 20 Words | Most frequent words |
| Vocab Coverage | Cumulative coverage curve |
| Embedding Isotropy | Vector space uniformity |
| Embedding Norms | Vector magnitude distribution |
| Embedding Similarity | Word similarity heatmap |
| Nearest Neighbors | Similar words for key terms |
| t-SNE Words | 2D word embedding visualization |
| t-SNE Sentences | 2D sentence embedding visualization |
| Position Encoding | Encoding method comparison |
| Model Sizes | Storage requirements |
| Performance Dashboard | Comprehensive performance overview |
---
## About This Project
### Data Source
Models trained on [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly) - a monthly snapshot of Wikipedia articles across 300+ languages.
### Project
A project by **[Wikilangs](https://wikilangs.org)** - Open-source NLP models for every Wikipedia language.
### Maintainer
[Omar Kamali](https://omarkamali.com) - [Omneity Labs](https://omneitylabs.com)
### Citation
If you use these models in your research, please cite:
```bibtex
@misc{wikilangs2025,
author = {Kamali, Omar},
title = {Wikilangs: Open NLP Models for Wikipedia Languages},
year = {2025},
doi = {10.5281/zenodo.18073153},
publisher = {Zenodo},
url = {https://huggingface.co/wikilangs}
institution = {Omneity Labs}
}
```
### License
MIT License - Free for academic and commercial use.
### Links
- ๐ŸŒ Website: [wikilangs.org](https://wikilangs.org)
- ๐Ÿค— Models: [huggingface.co/wikilangs](https://huggingface.co/wikilangs)
- ๐Ÿ“Š Data: [wikipedia-monthly](https://huggingface.co/datasets/omarkamali/wikipedia-monthly)
- ๐Ÿ‘ค Author: [Omar Kamali](https://huggingface.co/omarkamali)
- ๐Ÿค Sponsor: [Featherless AI](https://featherless.ai)
---
*Generated by Wikilangs Models Pipeline*
*Report Date: 2026-01-11 00:18:06*