/ Модель

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

Лицензия
CC BY-NC-SA 4.0
Библиотека
fasttext
Опубликована
30 сен 2026

lid-framework-models

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

Коллекция моделей FastText и классических классификаторов для определения языка короткого текста и выбора модели под конкретный корпус.

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

Бенчмарки

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

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

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

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

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

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

werner1hugo/lid-framework-models — коллекция из 102 моделей определения языка, разработанная Вернером Хуго в рамках магистерской работы MEng в Stellenbosch University. Модели входят в базу знаний фреймворка выбора моделей LID: он анализирует корпус коротких текстов и рекомендует подходящую модель или готовый детектор. В коллекции представлены варианты на Multinomial Naive Bayes, логистической регрессии и FastText с признаками символьных n-грамм или FastText-представлениями.

Модели классифицируют короткий текст по одному из языков, представленных в обучающем корпусе, и выдают код ISO 639-1. Подходящий сценарий — определение языка отдельных коротких сообщений или документов и выбор модели под конкретный корпус. Модели обучались на текстах длиной 30–120 символов (для китайского, японского и корейского — 10–40 символов); на данных своего корпуса среднее взвешенное F1 составляет 0,939–0,995, а при переносе на другой корпус качество резко падает. Коллекция не покрывает языки за пределами заданных высокоресурсных языков, выдаёт одну метку на документ и не обрабатывает переключение языков внутри текста. Лицензия — CC BY-NC-SA 4.0.

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

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

Ограничения

Покрывает только 24 высокоресурсных языка, присутствующих в конкретной обученной модели; тексты вне обучающего корпуса могут классифицироваться ненадёжно. Модели рассчитаны на короткие тексты, назначают один язык документу и не обрабатывают переключение языков.

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

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

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

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

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

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

Открыть на Hugging Face

LID framework: trained candidate models

These are the 102 trained language identification (LID) models that populate the Meta-Knowledge Base of the LID model selection framework (GitHub: Whugo226/lid_framework), developed for the MEng thesis An Interactive Framework for Language Identification Model Recommendation (Werner Hugo, Stellenbosch University, 2026).

The framework profiles an unlabelled short-text corpus and recommends one of these models (or one of three off-the-shelf detectors). Its dashboard downloads only the model it is asked to run, so you do not need to download this whole repository.

Contents

Six configurations were trained on each of 17 benchmark corpora (6 × 17 = 102 models):

ConfigurationFamilyFeaturesFile
bow_char_ngram_3_5Multinomial Naive Bayescharacter 3–5-grams, raw countsbest_pipeline.pkl
tfidf_char_ngram_3_5Multinomial Naive Bayescharacter 3–5-grams, TF-IDFbest_pipeline.pkl
bow_maxabs_lr_char_ngram_3_5Logistic regressioncharacter 3–5-grams, max-abs scaled countsbest_pipeline.pkl
tfidf_lr_char_ngram_3_5Logistic regressioncharacter 3–5-grams, TF-IDFbest_pipeline.pkl
fasttext_wordFastTextword unigrams, no subwordsmodel.bin
fasttext_subwordFastTextword bigrams + character subwords (2–4)model.bin

Files are laid out as {family}/{training_corpus}/{configuration}/, where {family} is naive_bayes, logistic_regression or fasttext. Each folder also holds run_metadata.json (selected hyperparameters and training-split metrics), classification_report.txt, and the hyperparameter search results.

Every model predicts ISO 639-1 codes for the subset of the 24 languages below that its training corpus contains. The FastText models are large (up to about 2.3 GB each); the Naive Bayes and logistic regression pipelines are 1–63 MB.

Usage

With the framework installed, the dashboard's Run model tab downloads and runs a model on demand. Programmatically:

from lid_toolkit.explainer.model_runner import ModelRunner

# store_datasets: the training-corpus names the variant names may end in
runner = ModelRunner(store_datasets=["xnli"])
runner.predict("fasttext_subword_xnli", ["Dit is een korte zin."])  # downloads on first use

Without the framework, the files load directly:

from huggingface_hub import hf_hub_download
import fasttext, pickle

ft = fasttext.load_model(hf_hub_download(
    "werner1hugo/lid-framework-models", "fasttext/xnli/fasttext_subword/model.bin"))
ft.predict("Dit is een korte zin.")

with open(hf_hub_download(
        "werner1hugo/lid-framework-models",
        "logistic_regression/xnli/tfidf_lr_char_ngram_3_5/best_pipeline.pkl"), "rb") as fh:
    lr = pickle.load(fh)
lr.predict(["Dit is een korte zin."])

The scikit-learn pipelines were saved with scikit-learn 1.8.0. The framework pins 1.7.2 (the version its Meta-Knowledge Base was built with); under 1.7.2 the pipelines load and predict correctly but scikit-learn prints an InconsistentVersionWarning. Only unpickle files from sources you trust.

Training

  • Every source document was truncated at a word boundary to at most 120 characters (40 for Chinese, Japanese and Korean); documents shorter than 30 characters (10 for CJK) were discarded.
  • Each corpus was split into four disjoint row-level parts under a fixed seed: 50% knowledge-training, 20% knowledge-benchmarking, 15% evaluation and 15% validation. Models were trained on the knowledge-training split only.
  • Hyperparameters were selected by macro-F1 on a stratified 80/20 split of the training data: randomised search with 5-fold (Naive Bayes) or 3-fold (logistic regression) cross-validation, and a grid over epochs and learning rate on a 90/10 split for FastText.

Performance and limitations

In-domain (evaluated on the same corpus they were trained on), mean weighted F1 ranges from 0.939 (FastText word) to 0.995 (FastText subword). Cross-domain performance collapses to a mean of about 0.55–0.61, with worst cases below 0.06: a model trained on one corpus can be unusable on another. That is why the framework recommends a model per corpus rather than one model for everything.

  • Only 24 high-resource languages are covered; any other language is misclassified.
  • The models were trained and evaluated on short text (30–120 characters).
  • They assign one language per document and do not handle code-switching.

Training corpora and licences

These models are derived from the corpora below. They are released under CC BY-NC-SA 4.0 (non-commercial, share-alike), the most restrictive terms among the corpora with stated licences. Use of an individual model is also subject to the terms of the corpus it was trained on. Licences are as stated on each dataset card at the time of release; "not stated" means the card gives none.

Training corpus (folder name)Hugging Face datasetLanguagesLicence on dataset card
OpenLID-v2laurievb/OpenLID-v223other (gated)
amazon_reviews_multineonwatty/amazon_reviews_multi6not stated
europarlHelsinki-NLP/europarl13unknown
exorde-social-media-december-2024-week1Exorde/exorde-social-media-december-2024-week124MIT
flores_plusopenlanguagedata/flores_plus23CC BY-SA 4.0 (gated)
language-identificationpapluca/language-identification12not stated
massiveAmazonScience/massive18CC BY 4.0
mmarcounicamp-dl/mmarco10not stated
multi_eurlexcoastalcph/multi_eurlex16CC BY-SA 4.0
multilingual_cc_newshotchpotch/multilingual_cc_news21not stated
multilingual_toxicity_datasettextdetox/multilingual_toxicity_dataset9OpenRAIL++
stsb_multi_mtPhilipMay/stsb_multi_mt10other
tweet_sentiment_multilingualcardiffnlp/tweet_sentiment_multilingual6not stated
tydiqagoogle-research-datasets/tydiqa5Apache 2.0
wikipediawikimedia/wikipedia24CC BY-SA 3.0, GFDL
xlsumcsebuetnlp/xlsum9CC BY-NC-SA 4.0
xnlifacebook/xnli7not stated

Languages counts the in-scope languages each corpus contains after filtering to the 24 supported languages.

Citation

If you use these models, please cite the thesis and the software archive (see CITATION.cff in the GitHub repository).

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

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

GPU в ailist

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

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

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

Ревизия весов
105138b

0 моделей