/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
fasttext
Опубликована
9 окт 2026

germanic-lid

Классификация текстаТекст → label7 профессий

Компактный классификатор fastText определяет английский и германские языки и помогает быстро фильтровать большие текстовые корпуса.

16скачиваний за 30 дней0лайковвеса обновлены29 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

hafsteinn/germanic-lid — компактный классификатор языков на базе fastText, разработанный Hafsteinn. Модель размером 6,3 МБ предназначена для определения английского и германских языков и диалектов в строках текста. Она выдаёт один из 16 классов: en, de, nl, af, fy, lb, gsw, yi, is, fo, da, sv, nb, nn, gem_other и other. Класс gem_other объединяет дополнительные германские разновидности, а other — негерманские языки и текстовый шум.

Модель рассчитана на фильтрацию больших текстовых корпусов на CPU и, согласно карточке, размечает около 25 000 строк в секунду на одном ядре. Обёртка нормализует текст, удаляя URL и адреса электронной почты, приводит символы к NFKC, переводит текст в нижний регистр и заменяет цифры на нули; затем проверяет письменность. Для работы с fastText напрямую README рекомендует применять ту же обработку. Репозиторий содержит квантизованную модель fastText с размерностью 64 и скрипт для предсказания, фильтрации и аннотирования JSONL и Parquet.

Модель распространяется по лицензии Apache-2.0. README приводит результаты на нескольких тестовых наборах и отмечает ошибки между близкими языками; например, норвежский букмол иногда классифицируется как нюнорск. На транскрибированной диалектной речи датский и норвежский текст может попадать в класс other, а высокий порог уверенности повышает точность ценой снижения полноты.

Сценарии применения

  • определение языка в строках корпуса
  • отбор английских и германских текстов из веб-данных
  • фильтрация корпусов для обучения языковых моделей
  • разметка JSONL и Parquet по языку
  • разделение близких скандинавских языков в текстовых данных

Ограничения

Класс gem_other объединяет разные германские разновидности, а ошибки возможны между близкими языками, в частности между букмолом и нюнорском. На транскрибированной диалектной речи модель может относить датские и норвежские строки к other; повышение порога уверенности снижает полноту.

Для каких профессий подходит7

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

germanic-lid

A 6.3 MB fastText language identifier for English and the Germanic languages. It has one class for other Germanic varieties and one other class for everything else. It is built for filtering large corpora on CPU and labels about 25,000 lines per second on one core.

This is version 2.1 (24 Oct 2026). Every fastText file was retrained on a uniformly shuffled copy of the same training data, with the same settings. The first release (v2.0, 9 Oct 2026) was trained on a file whose label mix drifted along it. That cost it accuracy on Bokmål against Nynorsk: v2.0 labelled 3.3% of the Bokmål FLORES-200 sentences as Nynorsk, and v2.1 labels 0.8%. v2.0 stays available at revision v2.0. TrustLLM D5.2 used pareto/germanic-lid-d128.bin from v2.0.

The 16 labels are en de nl af fy lb gsw yi is fo da sv nb nn gem_other other:

  • gsw: Alemannic / Swiss German.
  • gem_other: other Germanic varieties (Low German, Limburgish, Bavarian, North and Saterland Frisian, West Flemish, Zeelandic, Pennsylvania German, Kölsch, Palatine German). In a filter, treat gem_other as other, unless you want those varieties.
  • other: everything non-Germanic, plus non-language noise.

Files

FileWhat
germanic-lid.ftzquantised fastText model, 64 dimensions, 6.3 MB (the default)
labels.txtthe 16 labels
germanic_lid.pywrapper: GermanicLID(path).predict(lines, threshold) and a CLI to predict, filter or annotate JSONL and parquet
results/metrics JSON and tables for v2.1 (per-label P/R/F1 with bootstrap CIs, confusion matrices, hard pairs, threshold curves)
pareto/germanic-lid-d32.ftz2.6 MB, 31,000 lines/s/core
pareto/germanic-lid-d32.bin162 MB, unquantised, 45,000 lines/s/core: the best choice for bulk filtering
pareto/germanic-lid-d128.bin1.1 GB, our most accurate (macro-F1 0.985 on the independent sets)
pareto/PARETO.md, pareto/pareto.png, pareto/pareto.jsonaccuracy, speed and size of 20 systems and 4 cascades
pareto/archive/the d64 .bin and d128 .ftz of v2.1 with their training records; the d64 word-bigram model, char NB/LR and a CLD3-style network (trained in the v2.0 file order and not retrained); the superseded v1

Usage

from germanic_lid import GermanicLID
lid = GermanicLID("germanic-lid.ftz")
lid.predict(["Hvar er næsta strætóstoppistöð?", "Dette er ein test."], threshold=0.7)
python germanic_lid.py filter --model germanic-lid.ftz --input in.jsonl --field text --keep is,fo --threshold 0 --output out.jsonl
python germanic_lid.py filter --model germanic-lid.ftz --input in.parquet --field text --keep nb,nn --threshold 0.7 --output out.parquet

The first command keeps every line whose top label is is or fo, as in our filtering test below. The second keeps only lines labelled with a probability of at least 0.7. If you leave out --threshold, the CLI uses 0.5. The wrapper normalises the text before prediction: NFKC, lowercasing, URLs and e-mail addresses removed, digits mapped to 0. It then applies a script gate: a Germanic label needs mostly Latin letters (Hebrew for yi), and any other line becomes other. If you call fastText directly, apply the same normalisation.

Recipe

  • Training lines shuffled uniformly at random (NumPy permutation, seed 0).
  • fastText supervised, softmax; dim 64; char n-grams 2-5 plus words (minCount 50); 1M buckets; 3 epochs; lr 0.8; seed 0; 3 threads.
  • Quantised with qnorm, cutoff 150k, dsub 2 and 1 retrain epoch at lr 0.2.
  • d32: as above with cutoff 100k and 2 threads. d128: char n-grams 1-6, 2M buckets, cutoff 400k, 2 threads.
  • Trained on 7.95M lines: 400k-600k per large class; small classes upsampled to at most 3×; 2.6M lines for other.
  • Dedup by normalised-line hash; lines that occur under two labels are dropped; splits by document.

Training data

SourceUsed forLicence
OpenLID-v3 dataset (HPLT)most labels; other (180 languages + noise)per-source; all allow non-commercial use
Wikipedia 20231101every Germanic label and gem_other; close confusables in other (Sami, Greenlandic, Celtic, Romance minority languages, Sorbian, Finnic minority languages)CC BY-SA 4.0
FineWeb-2 trainfo, fy, lb, gsw, yi; a line is kept only if GlotLID agrees on that single lineODC-By 1.0
Our cleaned Icelandic corpus (private)ismixed source licences

Not used: glotlid-corpus (gated, no access); FLORES+ (gated, no access); Scots Wikipedia (quality problem).

Results

Our model (6.3 MB) against OpenLID-v3 (1.23 GB, with the preprocessing from its model card) and GlotLID v3 (1.69 GB), with the baselines' labels mapped to ours. Macro-F1 is over the 12 labels all three support. Accuracy covers all 16 labels. Speed is measured through Python on one core of an Apple M4 Max and includes our normalisation and script gate.

SetOursOpenLID-v3GlotLID
FLORES-200 devtest, macro-F10.9960.9950.997*
UDHR, macro-F10.9730.8880.990
Icelandic held-out documents, share labelled is0.9440.9180.898
same, accuracy against native-speaker labels0.9740.9530.944
In-domain held-out, macro-F10.9420.8820.917
Under 20 characters, accuracy0.7680.6260.706
20-50 characters, accuracy0.9160.7520.879
Synthetic web noise, accuracy0.9080.7540.801
FineWeb-2 web lines (agreement with GlotLID-derived labels)0.9080.7930.900
Lines/s, one core24,90016,8004,400

* GlotLID was trained on FLORES-200 dev.

Public test sets (accuracy, %):

SetOurs, 6.3 MBOurs, d32 .binGlotLIDOpenLID-v3
Nordic DSL (15K test, six labels)95.295.395.093.8
SLIDE, loose / exact96.1 / 92.296.2 / 92.397.2 / 93.494.5 / 90.5
FastSpell (Danish, Bokmål, Nynorsk)82.382.981.183.5
NorDial96.196.195.895.4
Tatoeba, our 14 Germanic languages91.691.793.284.2

Hard pairs on FLORES (share of the sentences of A labelled B):

PairOursOpenLID-v3GlotLID
nb→nn / nn→nb0.8% / 1.4%1.9% / 1.7%0.5% / 2.4%
nb→da / da→nb0.5% / 0.4%0.8% / 0.7%0.3% / 0.5%
is→fo / fo→is0.0% / 0.3%0.1% / 0.0%0.1% / 0.0%
nl↔af, de↔lb0.1% or less0.0%0.0%

For gsw, fy and gem_other, see the per-label tables in results/; OpenLID-v3 has none of them. 95% bootstrap CIs for every number are in results/tables_v2.1.md.

A threshold of 0.7 raises in-domain Germanic precision from 0.945 to 0.978 and costs 2.7 points of recall. On FLORES, precision is then 0.999 at 99.0% recall. Use it where a wrong label costs more than a lost line. It did not help when we filtered text for language-model training (next section), and on transcribed dialect speech (GEOVAR) it sends 10 to 12% of the Danish and Norwegian lines to other.

Filtering test

We filtered the Icelandic and Faroese parts of FineWeb-2 line by line with each identifier and trained a small byte-level language model (10.9M parameters, 32 MB of the kept text, the same for every filter) on what each one kept. A filter keeps a line when its top label is the target language. Kept is the share of characters kept. The other columns are bits per byte, lower is better, as the mean over three seeds for Icelandic and five for Faroese. FLORES is FLORES-200 dev and devtest; Web is 3 MB of FineWeb-2 test lines that all five identifiers label as the language.

FilterIcelandic: keptFLORESWebFaroese: keptFLORESWeb
None100%2.0341.845100%1.9471.755
GlotLID96.7%2.0281.84292.4%1.9281.738
OpenLID-v397.2%2.0311.84493.5%1.9341.742
heliport97.2%2.0311.84394.4%1.9361.742
This model (6.3 MB)97.6%2.0291.84295.0%1.9291.736
pareto/germanic-lid-d32.bin97.7%95.1%1.9301.738
This model, threshold 0.797.4%94.0%1.9331.738
pareto/germanic-lid-d32.bin, threshold 0.797.5%2.0341.84494.2%1.9381.744
  • Faroese: every filter beats the unfiltered text, by 0.8% on average. The differences between the identifiers are smaller than the spread between seeds (standard deviation 0.008 to 0.017).
  • Icelandic: filtering makes little difference. The filters drop only 2 to 3% of the characters, mostly short lines.
  • This model keeps the most text, because it labels fewer short lines other.
  • The 0.7 threshold brought no gain and may cost a little: over the ten pairs of Faroese runs with and without it, it raised bits per byte in eight on FLORES and seven on the web set, by 0.2 to 0.3% on average.
  • The models are small and read one fixed amount of text, so the test does not show whether the extra text a filter keeps is worth having at a larger scale.

Choosing a model

Every fastText file works with the same wrapper (--model <file>).

  • Bulk filtering: pareto/germanic-lid-d32.bin. Add the 0.7 threshold where precision matters more than coverage; for language-model training data our filtering test found no gain from it.
  • Small and portable: germanic-lid.ftz or pareto/germanic-lid-d32.ftz.
  • Short text or maximum accuracy: pareto/germanic-lid-d128.bin.
  • See pareto/PARETO.md.

Caveats

  • The label set is closed, so unseen Latin-script languages can receive a Germanic label, most often gem_other, en or gsw. Use a threshold.
  • On human-labelled web lines in English, German, Dutch, Frisian and Afrikaans (CommonLID), GlotLID and heliport are clearly more precise: macro-F1 over English, German, Dutch and Afrikaans is 0.834 and 0.828 against 0.731 for this model (0.786 with a threshold of 0.7). English and German lines often get a small-language label, and Hebrew lines often get yi. For those languages, prefer GlotLID; this model is built for the Nordic languages.
  • Bokmål against Nynorsk is the hardest pair for every system we tested; ours is level with GlotLID on it. Lines under 20 characters reach only about 77% accuracy (all systems struggle there).
  • gsw means Alemannic broadly (Wikipedia als includes Alsatian and Swabian).
  • The FineWeb-2 portion inherits GlotLID's line-level decisions for fo, fy, lb, gsw and yi.
  • The weights are released under Apache-2.0. Some training sources allow only non-commercial use (see the table above), so check their terms before commercial reuse.

Citation

@misc{einarsson2026germaniclid,
  author       = {Einarsson, Hafsteinn},
  title        = {germanic-lid: a fastText language identifier for English and the Germanic languages},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/hafsteinn/germanic-lid}}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · fasttext

Нельзя запустить

Модели fastText требуют отдельного рантайма.

Ревизия весов
fe0b210

0 моделей