CoolFace
Modelpublic

wikilangs/en

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
Model Card

English — Wikilangs Models

Open-source tokenizers, n-gram & Markov language models, vocabulary stats, and word embeddings trained on English Wikipedia by Wikilangs.

🌐 Language Page · 🎮 Playground · 📊 Full Research Report

Language Samples

Example sentences drawn from the English Wikipedia corpus:

Alexander V may refer to: Alexander V of Macedon (died 294 BCE) Antipope Alexander V Alexander V of Imereti
Alfonso IV may refer to: Alfonso IV of León (924–931) Afonso IV of Portugal Alfonso IV of Aragon Alfonso IV of Ribagorza Alfonso IV d'Este Duke of Modena and Regg
Anastasius I or Anastasios I may refer to: Anastasius I Dicorus (–518), Roman emperor Anastasius I of Antioch (died 599), Patriarch of Antioch Pope Anastasius I (died 401), pope
Angula may refer to: Aṅgula, a measure equal to a finger's breadth Eel, a biological order of fish Nahas Angula, former Prime Minister of Namibia Helmut Angula See also Angul (disambiguation)
Two antipopes used the regnal name Victor IV: Antipope Victor IV Antipope Victor IV

Quick Start

Load the Tokenizer

python
import sentencepiece as spm

sp = spm.SentencePieceProcessor()
sp.Load("en_tokenizer_32k.model")

text = "Albrecht Achilles may refer to: Albrecht III Achilles, Elector of Brandenburg Al"
tokens = sp.EncodeAsPieces(text)
ids    = sp.EncodeAsIds(text)

print(tokens)  # subword pieces
print(ids)     # integer ids

# Decode back
print(sp.DecodeIds(ids))

<details> <summary><b>Tokenization examples (click to expand)</b></summary>

Sample 1: Albrecht Achilles may refer to: Albrecht III Achilles, Elector of Brandenburg Al…

VocabTokensCount
8k▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht … (+27 more)37
16k▁alb recht ▁ach illes ▁may ▁refer ▁to : ▁alb recht … (+26 more)36
32k▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , … (+17 more)27
64k▁albrecht ▁achilles ▁may ▁refer ▁to : ▁albrecht ▁iii ▁achilles , … (+16 more)26

Sample 2: Alexander V may refer to: Alexander V of Macedon (died 294 BCE) Antipope Alexand…

VocabTokensCount
8k▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁maced … (+20 more)30
16k▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+18 more)28
32k▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+15 more)25
64k▁alexander ▁v ▁may ▁refer ▁to : ▁alexander ▁v ▁of ▁macedon … (+15 more)25

Sample 3: Two antipopes used the regnal name Victor IV: Antipope Victor IV Antipope Victor…

VocabTokensCount
8k▁two ▁antip op es ▁used ▁the ▁reg nal ▁name ▁victor … (+8 more)18
16k▁two ▁antip opes ▁used ▁the ▁reg nal ▁name ▁victor ▁iv … (+7 more)17
32k▁two ▁antip opes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : … (+6 more)16
64k▁two ▁antipopes ▁used ▁the ▁regnal ▁name ▁victor ▁iv : ▁antipope … (+5 more)15

</details>

Load Word Embeddings

python
from gensim.models import KeyedVectors

# Aligned embeddings (cross-lingual, mapped to English vector space)
wv = KeyedVectors.load("en_embeddings_128d_aligned.kv")

similar = wv.most_similar("word", topn=5)
for word, score in similar:
    print(f"  {word}: {score:.3f}")

Load N-gram Model

python
import pyarrow.parquet as pq

df = pq.read_table("en_3gram_word.parquet").to_pandas()
print(df.head())

Models Overview

[image]

CategoryAssets
TokenizersBPE at 8k, 16k, 32k, 64k vocab sizes
N-gram models2 / 3 / 4 / 5-gram (word & subword)
Markov chainsContext 1–5 (word & subword)
Embeddings32d, 64d, 128d — mono & aligned
VocabularyFull frequency list + Zipf analysis
StatisticsCorpus & model statistics JSON

Metrics Summary

ComponentModelKey MetricValue
Tokenizer8k BPECompression3.84x
Tokenizer16k BPECompression4.22x
Tokenizer32k BPECompression4.51x
Tokenizer64k BPECompression4.70x 🏆
N-gram2-gram (subword)Perplexity257 🏆
N-gram2-gram (word)Perplexity386,225
N-gram3-gram (subword)Perplexity2,180
N-gram3-gram (word)Perplexity4,093,782
N-gram4-gram (subword)Perplexity12,758
N-gram4-gram (word)Perplexity14,465,722
N-gram5-gram (subword)Perplexity55,700
N-gram5-gram (word)Perplexity12,820,936
Markovctx-1 (subword)Predictability0.0%
Markovctx-1 (word)Predictability6.2%
Markovctx-2 (subword)Predictability46.4%
Markovctx-2 (word)Predictability48.3%
Markovctx-3 (subword)Predictability45.8%
Markovctx-3 (word)Predictability75.9%
Markovctx-4 (subword)Predictability36.8%
Markovctx-4 (word)Predictability89.2% 🏆
VocabularyfullSize1,867,537
VocabularyfullZipf R²0.9862
Embeddingsmono_32dIsotropy0.7693 🏆
Embeddingsmono_64dIsotropy0.7388
Embeddingsmono_128dIsotropy0.6687

📊 [Full ablation study, per-model breakdowns, and interpretation guide →](RESEARCH_REPORT.md)


About

Trained on wikipedia-monthly — monthly snapshots of 300+ Wikipedia languages.

A project by [Wikilangs](https://wikilangs.org) · Maintainer: Omar Kamali · Omneity Labs

Citation

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}
}

Links

License: MIT — free for academic and commercial use.


Generated by Wikilangs Pipeline · 2026-03-03 22:59:51