Text Generation
fastText
Welsh
wikilangs
nlp
tokenizer
embeddings
n-gram
markov
wikipedia
feature-extraction
sentence-similarity
tokenization
n-grams
markov-chain
text-mining
babelvec
vocabulous
vocabulary
monolingual
family-celtic_brythonic
Run this model with HF Jobs
Run wikilangs/cy on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/wikilangs/cy. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/wikilangs/cy on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/wikilangs/cy. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/wikilangs/cy. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use wikilangs/cy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastText
How to use wikilangs/cy with fastText:
from huggingface_hub import hf_hub_download import fasttext model = fasttext.load_model(hf_hub_download("wikilangs/cy", "model.bin")) - Notebooks
- Google Colab
- Kaggle
Upload all models and assets for cy (20251201)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+6
- README.mdAdded+558
- models/embeddings/monolingual/cy_128d.binAdded+3
- models/embeddings/monolingual/cy_128d.meta.jsonAdded+1
- models/embeddings/monolingual/cy_128d_metadata.jsonAdded+13
- models/embeddings/monolingual/cy_32d.binAdded+3
- models/embeddings/monolingual/cy_32d.meta.jsonAdded+1
- models/embeddings/monolingual/cy_32d_metadata.jsonAdded+13
- models/embeddings/monolingual/cy_64d.binAdded+3
- models/embeddings/monolingual/cy_64d.meta.jsonAdded+1
- models/embeddings/monolingual/cy_64d_metadata.jsonAdded+13
- models/subword_markov/cy_markov_ctx1_subword.parquetAdded+3
- models/subword_markov/cy_markov_ctx1_subword_metadata.jsonAdded+7
- models/subword_markov/cy_markov_ctx2_subword.parquetAdded+3
- models/subword_markov/cy_markov_ctx2_subword_metadata.jsonAdded+7
- models/subword_markov/cy_markov_ctx3_subword.parquetAdded+3
- models/subword_markov/cy_markov_ctx3_subword_metadata.jsonAdded+7
- models/subword_markov/cy_markov_ctx4_subword.parquetAdded+3
- models/subword_markov/cy_markov_ctx4_subword_metadata.jsonAdded+7
- models/subword_ngram/cy_2gram_subword.parquetAdded+3
- models/subword_ngram/cy_2gram_subword_metadata.jsonAdded+7
- models/subword_ngram/cy_3gram_subword.parquetAdded+3
- models/subword_ngram/cy_3gram_subword_metadata.jsonAdded+7
- models/subword_ngram/cy_4gram_subword.parquetAdded+3
- models/subword_ngram/cy_4gram_subword_metadata.jsonAdded+7
- models/tokenizer/cy_tokenizer_16k.modelAdded+3
- models/tokenizer/cy_tokenizer_16k.vocabAdded
- models/tokenizer/cy_tokenizer_32k.modelAdded+3
- models/tokenizer/cy_tokenizer_32k.vocabAdded
- models/tokenizer/cy_tokenizer_64k.modelAdded+3
- models/tokenizer/cy_tokenizer_64k.vocabAdded
- models/tokenizer/cy_tokenizer_8k.modelAdded+3
- models/tokenizer/cy_tokenizer_8k.vocabAdded
- models/vocabulary/cy_vocabulary.parquetAdded+3
- models/vocabulary/cy_vocabulary_metadata.jsonAdded+16
- models/word_markov/cy_markov_ctx1_word.parquetAdded+3
- models/word_markov/cy_markov_ctx1_word_metadata.jsonAdded+7
- models/word_markov/cy_markov_ctx2_word.parquetAdded+3
- models/word_markov/cy_markov_ctx2_word_metadata.jsonAdded+7
- models/word_markov/cy_markov_ctx3_word.parquetAdded+3
- models/word_markov/cy_markov_ctx3_word_metadata.jsonAdded+7
- models/word_markov/cy_markov_ctx4_word.parquetAdded+3
- models/word_markov/cy_markov_ctx4_word_metadata.jsonAdded+7
- models/word_ngram/cy_2gram_word.parquetAdded+3
- models/word_ngram/cy_2gram_word_metadata.jsonAdded+7
- models/word_ngram/cy_3gram_word.parquetAdded+3
- models/word_ngram/cy_3gram_word_metadata.jsonAdded+7
- models/word_ngram/cy_4gram_word.parquetAdded+3
- models/word_ngram/cy_4gram_word_metadata.jsonAdded+7
- visualizations/embedding_isotropy.pngAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373839404132 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textvisualizations/embedding_similarity.png filter=lfs diff=lfs merge=lfs -textvisualizations/performance_dashboard.png filter=lfs diff=lfs merge=lfs -textvisualizations/position_encoding_comparison.png filter=lfs diff=lfs merge=lfs -textvisualizations/tsne_sentences.png filter=lfs diff=lfs merge=lfs -textvisualizations/tsne_words.png filter=lfs diff=lfs merge=lfs -textvisualizations/zipf_law.png filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558---language: cylanguage_name: Welshlanguage_family: celtic_brythonictags: - wikilangs - nlp - tokenizer - embeddings - n-gram - markov - wikipedia - monolingual - family-celtic_brythoniclicense: mitlibrary_name: wikilangspipeline_tag: feature-extractiondatasets: - omarkamali/wikipedia-monthlydataset_info: name: wikipedia-monthly description: Monthly snapshots of Wikipedia articles across 300+ languagesmetrics: - name: best_compression_ratio type: compression value: 3.377 - name: best_isotropy type: isotropy value: 0.8061 - name: vocabulary_size type: vocab value: 389645generated: 2025-12-29---
# Welsh - Wikilangs Models## Comprehensive Research Report & Full Ablation Study
This repository contains NLP models trained and evaluated by Wikilangs, specifically on **Welsh** 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-gram)- Markov chains (context of 1, 2, 3 and 4)- Subword N-gram and Markov chains- Embeddings in various sizes and dimensions- Language Vocabulary- Language Statistics
### 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. Summary & Recommendations](#6-summary--recommendations)- [Metrics Glossary](#appendix-metrics-glossary--interpretation-guide)- [Visualizations Index](#visualizations-index)
---## 1. Tokenizer Evaluation

### Results
| Vocab Size | Compression | Avg Token Len | UNK Rate | Total Tokens ||------------|-------------|---------------|----------|--------------|| **8k** | 2.890x | 2.85 | 0.0354% | 1,175,001 || **16k** | 3.105x | 3.07 | 0.0380% | 1,093,811 || **32k** | 3.264x | 3.22 | 0.0400% | 1,040,478 || **64k** | 3.377x 🏆 | 3.33 | 0.0414% | 1,005,729 |
### Tokenization Examples
Below are sample sentences tokenized with each vocabulary size:
**Sample 1:** `Roedd Despoena (hefyd Despina) yn nymff oedd yn ferch i Boseidon a Demeter ym my...`
| Vocab | Tokens | Count ||-------|--------|-------|| 8k | `▁roedd ▁des po ena ▁( h efyd ▁des p ina ... (+26 more)` | 36 || 16k | `▁roedd ▁des po ena ▁( hefyd ▁des p ina ) ... (+23 more)` | 33 || 32k | `▁roedd ▁des po ena ▁( hefyd ▁desp ina ) ▁yn ... (+20 more)` | 30 || 64k | `▁roedd ▁des po ena ▁( hefyd ▁desp ina ) ▁yn ... (+17 more)` | 27 |
**Sample 2:** `Gregg Township, Centre County, PennsylvaniaGregg Township, Union County, Pennsy...`
| Vocab | Tokens | Count ||-------|--------|-------|| 8k | `▁greg g ▁township , ▁cent re ▁county , ▁pennsylvania ▁greg ... (+7 more)` | 17 || 16k | `▁greg g ▁township , ▁centre ▁county , ▁pennsylvania ▁greg g ... (+6 more)` | 16 || 32k | `▁gregg ▁township , ▁centre ▁county , ▁pennsylvania ▁gregg ▁township , ... (+4 more)` | 14 || 64k | `▁gregg ▁township , ▁centre ▁county , ▁pennsylvania ▁gregg ▁township , ... (+4 more)` | 14 |
**Sample 3:** `Ceir sawl Swydd Butte yn yr Unol Daleithiau:
Swydd Butte, Califfornia Swydd B...`
| Vocab | Tokens | Count ||-------|--------|-------|| 8k | `▁ceir ▁sawl ▁swydd ▁butt e ▁yn ▁yr ▁unol ▁daleithiau : ... (+16 more)` | 26 || 16k | `▁ceir ▁sawl ▁swydd ▁butt e ▁yn ▁yr ▁unol ▁daleithiau : ... (+16 more)` | 26 || 32k | `▁ceir ▁sawl ▁swydd ▁butt e ▁yn ▁yr ▁unol ▁daleithiau : ... (+16 more)` | 26 || 64k | `▁ceir ▁sawl ▁swydd ▁butte ▁yn ▁yr ▁unol ▁daleithiau : ▁swydd ... (+12 more)` | 22 |
### Key Findings
- **Best Compression:** 64k achieves 3.377x compression- **Lowest UNK Rate:** 8k with 0.0354% 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


### Results
| N-gram | Perplexity | Entropy | Unique N-grams | Top-100 Coverage | Top-1000 Coverage ||--------|------------|---------|----------------|------------------|-------------------|| **2-gram** | 14,574 🏆 | 13.83 | 870,365 | 26.9% | 51.5% || **2-gram** | 329 🏆 | 8.36 | 17,053 | 62.3% | 99.0% || **3-gram** | 35,282 | 15.11 | 1,913,384 | 21.8% | 43.7% || **3-gram** | 2,419 | 11.24 | 127,945 | 27.9% | 70.4% || **4-gram** | 69,076 | 16.08 | 3,444,441 | 17.0% | 37.6% || **4-gram** | 10,383 | 13.34 | 705,121 | 18.5% | 47.3% |
### Top 5 N-grams by Size
**2-grams:**
| Rank | N-gram | Count ||------|--------|-------|| 1 | `categori :` | 1,494,932 || 2 | `- 01` | 1,376,508 || 3 | `: ffilmiau` | 1,056,825 || 4 | `01 -` | 688,052 || 5 | `' r` | 677,131 |
**3-grams:**
| Rank | N-gram | Count ||------|--------|-------|| 1 | `categori : ffilmiau` | 1,056,809 || 2 | `- 01 -` | 688,032 || 3 | `01 - 01` | 668,773 || 4 | `unol daleithiau america` | 448,243 || 5 | `cyfeiriadau categori :` | 227,847 |
**4-grams:**
| Rank | N-gram | Count ||------|--------|-------|| 1 | `- 01 - 01` | 668,772 || 2 | `unol daleithiau america saesneg` | 152,032 || 3 | `gan gynnwys y canlynol` | 142,457 || 4 | `gynnwys y canlynol :` | 142,446 || 5 | `o ffilmiau gan gynnwys` | 141,007 |
### Key Findings
- **Best Perplexity:** 2-gram with 329- **Entropy Trend:** Decreases with larger n-grams (more predictable)- **Coverage:** Top-1000 patterns cover ~47% of corpus- **Recommendation:** 4-gram or 5-gram for best predictive performance
---## 3. Markov Chain Evaluation


### Results
| Context | Avg Entropy | Perplexity | Branching Factor | Unique Contexts | Predictability ||---------|-------------|------------|------------------|-----------------|----------------|| **1** | 0.7241 | 1.652 | 7.40 | 841,116 | 27.6% || **1** | 1.3771 | 2.597 | 9.31 | 5,659 | 0.0% || **2** | 0.4190 | 1.337 | 2.47 | 6,216,866 | 58.1% || **2** | 0.7856 | 1.724 | 5.09 | 52,646 | 21.4% || **3** | 0.1820 | 1.134 | 1.44 | 15,354,414 | 81.8% || **3** | 0.7948 | 1.735 | 4.45 | 267,808 | 20.5% || **4** | 0.0927 🏆 | 1.066 | 1.20 | 22,160,397 | 90.7% || **4** | 0.7045 🏆 | 1.630 | 3.44 | 1,190,900 | 29.5% |
### Generated Text Samples
Below are text samples generated from each Markov chain model:
**Context Size 1:**
1. `. ymosododd ar ddeg ysgrif ) eu brest . derbyniad gweler hefyd cyhoeddodd carlos roffé ,`2. `- 01 ez naiz sbaen sbaeneg a ' w gael eu galw ' r ffilm gore`3. `y cyfarwyddwr ffilm ddrama gan gyfarwyddwyr ffilm maneater a chyfansoddwyd y deyrnas unedig saesneg ...`
**Context Size 2:**
1. `categori : ffilmiau 1968 categori : gwyddonwyr ffrengig categori : ffilmiau 2006 categori : ffilmiau...`2. `- 01 just in roseland . ar ôl i weld ei thad wedi cyfaddef mewn u od`3. `: ffilmiau dogfen categori : ffilmiau saesneg wedi gweld golau dydd . cyfarwyddwr ganwyd y cyfarwydd...`
**Context Size 3:**
1. `categori : ffilmiau gyda llai na 10 o actorion lleisiol categori : ffilmiau comedi categori : dramâu...`2. `- 01 - 01 jenatsch ffraincyr almaeny swistir almaenegportiwgalegsaesnegffrangeg 2018 - 05 - 15 prese...`3. `01 - 01 glamour y deyrnas unedig saesneg 1950 - 01 - 01 zero india 2018 - 01`
**Context Size 4:**
1. `- 01 - 01 la folie du doute ffrainc no / unknown value 1914 - 01 - 01 en`2. `unol daleithiau america saesneg 1977 - 01 - 01 who will marry me ? unol daleithiau america 1964 -`3. `gan gynnwys y canlynol : ffilm delwedd gwlad iaith wreiddiol dyddiad behind the scenes center | 100p...`
### Key Findings
- **Best Predictability:** Context-4 with 90.7% predictability- **Branching Factor:** Decreases with context size (more deterministic)- **Memory Trade-off:** Larger contexts require more storage (1,190,900 contexts)- **Recommendation:** Context-3 or Context-4 for text generation
---## 4. Vocabulary Analysis



### Statistics
| Metric | Value ||--------|-------|| Vocabulary Size | 389,645 || Total Tokens | 63,461,717 || Mean Frequency | 162.87 || Median Frequency | 5 || Frequency Std Dev | 8486.55 |
### Most Common Words
| Rank | Word | Frequency ||------|------|-----------|| 1 | y | 2,296,979 || 2 | yn | 2,179,510 || 3 | o | 1,595,326 || 4 | categori | 1,496,135 || 5 | a | 1,393,254 || 6 | 01 | 1,383,521 || 7 | ffilmiau | 1,310,809 || 8 | ffilm | 1,218,970 || 9 | gan | 925,807 || 10 | r | 732,675 |
### Least Common Words (from vocabulary)
| Rank | Word | Frequency ||------|------|-----------|| 1 | bulac | 2 || 2 | geirfaoedd | 2 || 3 | volcabulaire | 2 || 4 | ethnolog | 2 || 5 | siculu | 2 || 6 | metafonetig | 2 || 7 | defynydd | 2 || 8 | clwsterau | 2 || 9 | ŋm | 2 || 10 | ŋw | 2 |
### Zipf's Law Analysis
| Metric | Value ||--------|-------|| Zipf Coefficient | 1.2070 || R² (Goodness of Fit) | 0.997118 || Adherence Quality | **excellent** |
### Coverage Analysis
| Top N Words | Coverage ||-------------|----------|| Top 100 | 48.9% || Top 1,000 | 73.9% || Top 5,000 | 85.7% || Top 10,000 | 89.6% |
### Key Findings
- **Zipf Compliance:** R²=0.9971 indicates excellent adherence to Zipf's law- **High Frequency Dominance:** Top 100 words cover 48.9% of corpus- **Long Tail:** 379,645 words needed for remaining 10.4% coverage
---## 5. Word Embeddings Evaluation




### Model Comparison
| Model | Vocab Size | Dimension | Avg Norm | Std Norm | Isotropy ||-------|------------|-----------|----------|----------|----------|| **mono_32d** | 302,236 | 32 | 4.313 | 1.212 | 0.8061 🏆 || **mono_64d** | 302,236 | 64 | 4.810 | 1.191 | 0.7892 || **mono_128d** | 302,236 | 128 | 5.402 | 1.237 | 0.7570 || **embeddings_enhanced** | 0 | 0 | 0.000 | 0.000 | 0.0000 |
### Key Findings
- **Best Isotropy:** mono_32d with 0.8061 (more uniform distribution)- **Dimension Trade-off:** Higher dimensions capture more semantics but reduce isotropy- **Vocabulary Coverage:** All models cover 302,236 words- **Recommendation:** 100d for balanced semantic capture and efficiency
---## 6. Summary & Recommendations

### Production Recommendations
| Component | Recommended | Rationale ||-----------|-------------|-----------|| Tokenizer | **32k BPE** | Best compression (3.38x) with low UNK rate || N-gram | **5-gram** | Lowest perplexity (329) || Markov | **Context-4** | Highest predictability (90.7%) || 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}, publisher = {HuggingFace}, 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)---*Generated by Wikilangs Models Pipeline*
*Report Date: 2025-12-29 06:44:48*123version https://git-lfs.github.com/spec/v1oid sha256:8032ea070b9a556d69743a6ba1afe7ceb90f929ed90f38a19a929db0cc5fbf9csize 13390387161{"lang": "cy", "dim": 128, "max_seq_len": 512, "is_aligned": false}12345678910111213{ "language": "cy", "dimension": 128, "version": "monolingual", "training_params": { "dim": 128, "min_count": 5, "window": 5, "negative": 5, "epochs": 5 }, "vocab_size": 302236}123version https://git-lfs.github.com/spec/v1oid sha256:0dbe9dbf660202119679aac32782c94ce45f3981db2e982117998f8735eb0b66size 3389214681{"lang": "cy", "dim": 32, "max_seq_len": 512, "is_aligned": false}12345678910111213{ "language": "cy", "dimension": 32, "version": "monolingual", "training_params": { "dim": 32, "min_count": 5, "window": 5, "negative": 5, "epochs": 5 }, "vocab_size": 302236}123version https://git-lfs.github.com/spec/v1oid sha256:2c29cde8e0a588f9cf6c2b2790bb7a742001e3649cf9e7c1459ff7be61d341c6size 6722938841{"lang": "cy", "dim": 64, "max_seq_len": 512, "is_aligned": false}12345678910111213{ "language": "cy", "dimension": 64, "version": "monolingual", "training_params": { "dim": 64, "min_count": 5, "window": 5, "negative": 5, "epochs": 5 }, "vocab_size": 302236}123version https://git-lfs.github.com/spec/v1oid sha256:e7be1214f6fb63a919f01f8997bc9434554ba27fdf4308fec51ca834b5c60d83size 3649511234567{ "context_size": 1, "variant": "subword", "language": "cy", "unique_contexts": 5659, "total_transitions": 395609240}123version https://git-lfs.github.com/spec/v1oid sha256:5dc3880004368f38d82df372289042ec774f9021cdd7a537c7d1040e36c2dba7size 22155611234567{ "context_size": 2, "variant": "subword", "language": "cy", "unique_contexts": 52646, "total_transitions": 395325415}123version https://git-lfs.github.com/spec/v1oid sha256:7fe74491901bd644df2ecce9a56a7f7443c39c955a3d40a7050cd6821f2cdc17size 100777911234567{ "context_size": 3, "variant": "subword", "language": "cy", "unique_contexts": 267808, "total_transitions": 395041590}123version https://git-lfs.github.com/spec/v1oid sha256:2bff5e3485ba67f8fb246702a093233ac90553839e243a24c8399bf5c13888d1size 333142531234567{ "context_size": 4, "variant": "subword", "language": "cy", "unique_contexts": 1190900, "total_transitions": 394757765}123version https://git-lfs.github.com/spec/v1oid sha256:f0fef0a9228eba40b4017257ab0c383dd88a8a64e506ed4585323df321064c59size 2345911234567{ "n": 2, "variant": "subword", "language": "cy", "unique_ngrams": 17053, "total_ngrams": 395609240}123version https://git-lfs.github.com/spec/v1oid sha256:dca13224e4c4a821574aeb63066a78b395af4320995e437d830a9f29a02ec455size 16061151234567{ "n": 3, "variant": "subword", "language": "cy", "unique_ngrams": 127945, "total_ngrams": 395325415}123version https://git-lfs.github.com/spec/v1oid sha256:c30610d2431ebfd59727ef6174314d6ed4de69340eabb205c85b4149c435ea29size 82864931234567{ "n": 4, "variant": "subword", "language": "cy", "unique_ngrams": 705121, "total_ngrams": 395041590}123version https://git-lfs.github.com/spec/v1oid sha256:54f1e149a19959f257fa6d275287ecee0003f2b90cac7ab3ac44c70ddd67bec3size 504780123version https://git-lfs.github.com/spec/v1oid sha256:e29cd5ea4c2b78e8e7182e943efa0282f70d1c58cc36390447563f0e71fe4388size 779387123version https://git-lfs.github.com/spec/v1oid sha256:a53705a33984a063d3ea0ad404e8784046151432af2368b824d34685610e90c9size 1341924123version https://git-lfs.github.com/spec/v1oid sha256:f133e678d0bcd9cee54f10e779a871317fabfe9f02dab45ef63562e0768302absize 371729123version https://git-lfs.github.com/spec/v1oid sha256:c77a77f2457dbcc78ea0ac032b77197d09e5fc107e8ff1a37fcc6a47715503f1size 589370812345678910111213141516{ "language": "cy", "vocabulary_size": 389645, "statistics": { "type_token_ratio": 0.0131546528620712, "coverage": { "top_100": 0.48536421243668115, "top_1000": 0.7336080742357445, "top_5000": 0.8512773563452204, "top_10000": 0.889406496721323 }, "hapax_count": 451106, "hapax_ratio": 0.5365512500133809, "total_documents": 283825 }}123version https://git-lfs.github.com/spec/v1oid sha256:42d7b87be999fc860a768fb63310dce637913b0cdd04e1a5762efc6ffd96e12csize 552610511234567{ "context_size": 1, "variant": "word", "language": "cy", "unique_contexts": 841116, "total_transitions": 77665759}123version https://git-lfs.github.com/spec/v1oid sha256:df2e9a656905791c64c690564408ef31601ec967e17bec7c732dfa37774ffa8bsize 1648043331234567{ "context_size": 2, "variant": "word", "language": "cy", "unique_contexts": 6216866, "total_transitions": 77381936}123version https://git-lfs.github.com/spec/v1oid sha256:bc414c93d4a3dffbe362ee827c9da514ed08dd5d7d24d42180a9a40fa0a2b4f0size 2904313111234567{ "context_size": 3, "variant": "word", "language": "cy", "unique_contexts": 15354414, "total_transitions": 77098113}123version https://git-lfs.github.com/spec/v1oid sha256:5bee07f562fa1f6ca3c908cc60f39d2e13e6b0310d4a38d59d23284f2b2d386dsize 3884724121234567{ "context_size": 4, "variant": "word", "language": "cy", "unique_contexts": 22160397, "total_transitions": 76814291}123version https://git-lfs.github.com/spec/v1oid sha256:58ef03fcf5abf6b2db3f2ed655f5d618cda63bce23413baaf63e43e500343074size 118190161234567{ "n": 2, "variant": "word", "language": "cy", "unique_ngrams": 870365, "total_ngrams": 77665759}123version https://git-lfs.github.com/spec/v1oid sha256:a2a98ce876a4de4dc036d3eb5b2bef7933796382ed59983236ce05a8606b9563size 274175521234567{ "n": 3, "variant": "word", "language": "cy", "unique_ngrams": 1913384, "total_ngrams": 77381936}123version https://git-lfs.github.com/spec/v1oid sha256:db5a4ba1f07689c9421968d55da12ceb369820eb26ad1a8c64b3d560123c8993size 521085551234567{ "n": 4, "variant": "word", "language": "cy", "unique_ngrams": 3444441, "total_ngrams": 77098113}.gitattributes+6
README.mdAdded+558
models/embeddings/monolingual/cy_128d.binAdded+3
models/embeddings/monolingual/cy_128d.meta.jsonAdded+1
models/embeddings/monolingual/cy_128d_metadata.jsonAdded+13
models/embeddings/monolingual/cy_32d.binAdded+3
models/embeddings/monolingual/cy_32d.meta.jsonAdded+1
models/embeddings/monolingual/cy_32d_metadata.jsonAdded+13
models/embeddings/monolingual/cy_64d.binAdded+3
models/embeddings/monolingual/cy_64d.meta.jsonAdded+1
models/embeddings/monolingual/cy_64d_metadata.jsonAdded+13
models/subword_markov/cy_markov_ctx1_subword.parquetAdded+3
models/subword_markov/cy_markov_ctx1_subword_metadata.jsonAdded+7
models/subword_markov/cy_markov_ctx2_subword.parquetAdded+3
models/subword_markov/cy_markov_ctx2_subword_metadata.jsonAdded+7
models/subword_markov/cy_markov_ctx3_subword.parquetAdded+3
models/subword_markov/cy_markov_ctx3_subword_metadata.jsonAdded+7
models/subword_markov/cy_markov_ctx4_subword.parquetAdded+3
models/subword_markov/cy_markov_ctx4_subword_metadata.jsonAdded+7
models/subword_ngram/cy_2gram_subword.parquetAdded+3
models/subword_ngram/cy_2gram_subword_metadata.jsonAdded+7
models/subword_ngram/cy_3gram_subword.parquetAdded+3
models/subword_ngram/cy_3gram_subword_metadata.jsonAdded+7
models/subword_ngram/cy_4gram_subword.parquetAdded+3
models/subword_ngram/cy_4gram_subword_metadata.jsonAdded+7
models/tokenizer/cy_tokenizer_16k.modelAdded+3
models/tokenizer/cy_tokenizer_16k.vocabAdded
models/tokenizer/cy_tokenizer_32k.modelAdded+3
models/tokenizer/cy_tokenizer_32k.vocabAdded
models/tokenizer/cy_tokenizer_64k.modelAdded+3
models/tokenizer/cy_tokenizer_64k.vocabAdded
models/tokenizer/cy_tokenizer_8k.modelAdded+3
models/tokenizer/cy_tokenizer_8k.vocabAdded
models/vocabulary/cy_vocabulary.parquetAdded+3
models/vocabulary/cy_vocabulary_metadata.jsonAdded+16
models/word_markov/cy_markov_ctx1_word.parquetAdded+3
models/word_markov/cy_markov_ctx1_word_metadata.jsonAdded+7
models/word_markov/cy_markov_ctx2_word.parquetAdded+3
models/word_markov/cy_markov_ctx2_word_metadata.jsonAdded+7
models/word_markov/cy_markov_ctx3_word.parquetAdded+3
models/word_markov/cy_markov_ctx3_word_metadata.jsonAdded+7
models/word_markov/cy_markov_ctx4_word.parquetAdded+3
models/word_markov/cy_markov_ctx4_word_metadata.jsonAdded+7
models/word_ngram/cy_2gram_word.parquetAdded+3
models/word_ngram/cy_2gram_word_metadata.jsonAdded+7
models/word_ngram/cy_3gram_word.parquetAdded+3
models/word_ngram/cy_3gram_word_metadata.jsonAdded+7
models/word_ngram/cy_4gram_word.parquetAdded+3
models/word_ngram/cy_4gram_word_metadata.jsonAdded+7
visualizations/embedding_isotropy.pngAdded
