NagaYu/tessera-mixed-pages
Tessera mixed-page corpus Synthetic multilingual web pages with exact span boundaries and multi-label language annotations, for training and evaluating span-level language identification. Why this is synthetic, stated up front No public corpus annotates span boundaries and languages inside real multilingual web pages at scale. Annotating one by hand across 479 languages, most of them low-resource, is not feasible and would itself be error-prone in exactly the… See the full description on the dataset page: https://huggingface.co/datasets/NagaYu/tessera-mixed-pages.
Tessera mixed-page corpus
Synthetic multilingual web pages with exact span boundaries and multi-label language annotations, for training and evaluating span-level language identification.
Why this is synthetic, stated up front
No public corpus annotates span boundaries and languages inside real multilingual web pages at scale. Annotating one by hand across 479 languages, most of them low-resource, is not feasible and would itself be error-prone in exactly the places that matter most.
So the gold labels here are constructive: each document is assembled from source sentences of known language, and each span's offsets and language are recorded as it is placed. The boundaries are exact by definition.
The cost is real and is not hidden: the difficulty of this corpus was chosen by its authors. Results measured on it are labelled synthetic wherever they appear, and the accompanying repository reports real-data checks separately.
Contents
test_adversarial applies every degradation layer aggressively. test_romanized contains only non-Latin-script body languages, romanised with probability 1.0.
How a document is built
Pages imitate real furniture, because that furniture is why document-level LID discards low-resource text: navigation, footers, advertising and copyright lines are very often English even on a page whose body is not.
Archetypes:
buried_body-- body in a mid/tail language, chrome in English. Document-level LID labels the page English, and the body is lost.buried_minority-- body in English with a quote or comment block in another language. The document survives filtering as English, and the minority text is silently absorbed into an English corpus.codeswitch_heavy,short_span_heavy,monolingual(control).
Degradation layers
shorten (5-20 chars), informalize (repetition, emoji, case, punctuation, abbreviation, typos -- all script-generic, no English-specific slang), romanize, codeswitch, mojibake (encoding round-trip damage), html_residue. Each span records which layers were applied, so results can be stratified by condition.
Multi-label definition
Two kinds of multi-label, scored differently, and which labels are correct is measured rather than asserted:
- `any` (alternatives). A string attested in several languages' source corpora gets all of them. The token
Massais attested in dozens of Latin-script languages; any one is correct, and predicting all of them earns no extra credit. - `all` (code-switching). The span really contains every listed language, so each is separately required.
- `script_only`. Digits, punctuation and symbols get
undand are scored on whether a system declines to name a language.
primary always records the language the text was actually sampled from, so recall-per-language can never be inflated by permissive alternates.
Sources and licensing
Effective licence: CC-BY-SA-4.0. FLORES-200 is CC-BY-SA-4.0 and its share-alike term propagates to any corpus containing its sentences.
No scraped web text is redistributed. Only material whose licence permits redistribution is published.
Resource tiers
Defined operationally, not editorially: head = in fastText lid.176's label space, mid = absent from that but present in GlotLID or OpenLID, tail = covered by no evaluated document-level LID. Counts: {'tail': 50, 'mid': 282, 'head': 147}.
Known weaknesses
Please read these before using this corpus for anything consequential.
- Register. UDHR is formal legal prose and FLORES is encyclopaedic. Neither is conversational. The
informalizelayer approximates informality; it does not sample it from real usage. - Romanisation is systematic transliteration, not attested user romanisation. Real users writing Hindi or Tigrinya in Latin script do not follow a transliteration standard. Anything trained or evaluated on this layer is measuring an approximation, and Han, Kana and Hangul are excluded entirely because character-reading transliteration produces text no human would write.
- Page structure is templated. Five archetypes cannot cover the real diversity of the web.
- Sentence counts are very uneven. Some languages have 40 UDHR sentences and others have 997 FLORES sentences; the per-language table below gives the exact figure, and any per-language claim should be read against it.
- Language identity is contested for some codes. Where a macrolanguage and its varieties both appear, the labels follow the source corpus's choices, which are not neutral and may not match a speaker community's own view.
- Tail languages are only 50 of the 479 here. GlotLID covers 2,102 labels, so the population most at risk in this corpus is
mid: languages that existing LID knows but that document-level application discards anyway.
Language coverage
Links
- Code: <https://github.com/NagaYu/tessera>
- Model: <https://huggingface.co/NagaYu/tessera-span-lid>
- Demo (runs in your browser): <https://huggingface.co/spaces/NagaYu/tessera>
Citation
Built with Tessera -- span-level multi-label language identification. Repository: NagaYu/tessera-mixed-pages.
