/ Модель

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

Контекст
8 192 токена
Параметры
140 млн
Лицензия
MIT
Архитектура
modernbert · dense
Базовая модель
mmBERT-small
Библиотека
transformers
Опубликована
12 окт 2026

MixLID

Разметка токеновТекст → label

MixLID определяет языки отдельных токенов и языковые фрагменты в мультиязычном тексте, включая переключения между языками.

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

Бенчмарки

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

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

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

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

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

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

MixLID — мультиязычная модель лаборатории NLP AI Lab для определения языка на уровне токенов в обычном и смешанном тексте. Она дообучена на mmBERT-small и использует энкодер ModernBERT с головой классификации токенов. Модель поддерживает 111 языковых меток, включая варианты письма, а также отдельные метки для чисел, пунктуации и символов. Она возвращает языковые фрагменты и позволяет определить преобладающий язык всего текста.

Модель предназначена для фильтрации и разметки мультиязычных корпусов, поиска переключений между языками и проверки языковой согласованности сгенерированных ответов. Контекст составляет до 8192 токенов; для текстов без языковых предсказаний вспомогательная функция возвращает метку und. Оценка преобладающего языка — доля голосов победившего класса, а не калиброванная вероятность. Весы опубликованы в формате safetensors; лицензия MIT.

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

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

Ограничения

Оценка преобладающего языка является долей голосов, а не калиброванной вероятностью; результат und для пустого ввода или отсутствия языковых голосов — вспомогательный fallback. Точность может зависеть от языка, письменности и состава смешанного текста.

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

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

Открыть на Hugging Face

MixLID

Token-Level Language Identification in Mixed-Language Text

Demo: Hugging Face Space

Paper: Coming soon.

MixLID identifies the language of individual tokens, including short expressions embedded in another language. It supports 111 language labels and returns both language spans and one predominant language per input. Numbers, punctuation, and symbols have separate labels: NUM, PUNCT, and SYM.

Highlights

  • Identify languages within mixed text: locate language spans, including short expressions embedded in another language, across 111 supported language labels.
  • Two prediction modes: identify the language of individual tokens or the predominant language of an entire input with the same model.
PropertyMixLID
BackbonemmBERT-small
ArchitectureEncoder with a token classification head
Supported inputsMonolingual and mixed-language text
Language coverage111 language labels
Auxiliary labelsNUM, PUNCT, SYM
Prediction modesToken-level predictions and predominant input language
Output detailsLanguage labels, character offsets, and prediction scores
Context window8,192 tokens

Potential applications

ApplicationPotential use of MixLID
Multilingual data filteringSelect text in target languages and locate other-language spans within documents.
Reinforcement learning and generation evaluationMeasure whether responses follow the requested language, and explore language consistency as a reward component, including unwanted language mixing.
Speech and audio-text researchCheck transcript languages, annotate mixed-language transcripts, and compare text-side labels with audio-language predictions during corpus preparation.

Usage

pip install torch==2.9.1 transformers==4.57.0 safetensors==0.7.0

Load the downloaded model directory, or replace "./MixLID" with the published Hugging Face model ID:

from transformers import AutoModel

model = AutoModel.from_pretrained("./MixLID", trust_remote_code=True)
# To use a GPU: model = model.to("cuda:0")

text = "The exhibition brings together photographs and handwritten letters."
sentence = model.predict_sentence(text)
print(sentence["language"], sentence["score"])

result = model.predict_tokens(text)
for span in result["spans"]:
    print(span["text"], span["label"], span["start"], span["end"], span["score"])

trust_remote_code=True loads the prediction methods included in this repository. When using a Hub model ID, Transformers downloads the required Python files automatically.

Download the repository, including mixlid.py, and run Python from that directory:

from mixlid import MixLID

model = MixLID.from_pretrained()  # Loads the checkpoint beside mixlid.py.
# To use a GPU: model = MixLID.from_pretrained(device="cuda:0")

text = "The exhibition brings together photographs and handwritten letters."
sentence = model.predict_sentence(text)
print(sentence["language"], sentence["score"])

result = model.predict_tokens(text)
for span in result["spans"]:
    print(span["text"], span["label"], span["start"], span["end"], span["score"])

This method loads the built-in Transformers architecture without enabling remote code. Both interfaces provide the same predictions: predict_sentence() returns the predominant language of each input, and predict_tokens() returns subword predictions and merged language spans. Both accept a string or a list of strings. predict_sentence() does not split paragraphs into sentences.

Examples

The outputs below were checked with the released checkpoint.

Korean, English, and French

text = '연구팀은 대학원생들과 함께 1,000개 문서를 검토했고, the initial results를 바탕으로 오류 유형을 정리했다. 프랑스 측은 «Nous allons poursuivre cette recherche avec une équipe internationale.»라고 밝혔다. 평균 점수는 3.14였으며, 다음 분석에서는 a larger sample을 사용할 예정이다.'

result = model.predict_tokens(text)
result["spans"]  # Each span contains text, start, end, label, and score.
LabelPredicted spans
kor_Hang연구팀은 대학원생들과 함께 · 개 문서를 검토했고 · 를 바탕으로 오류 유형을 정리했다 · 프랑스 측은 · 라고 밝혔다 · 평균 점수는 · 였으며 · 다음 분석에서는 · 을 사용할 예정이다
NUM1,000 · 3.14
PUNCT, · . · « · .» · . · , · .
eng_Latnthe initial results · a larger sample
fra_LatnNous allons poursuivre cette recherche avec une équipe internationale

Turkish, German, and English

text = 'Yeni sergiye nach der Arbeit gitmeyi düşünüyoruz; girişte free admission yazıyor ama atölyeler için eine Anmeldung gerekiyor. Çocuklara yönelik bölümde hands-on activities var, bu yüzden mit der ganzen Familie gitmek daha keyifli olabilir.'

result = model.predict_tokens(text)
result["spans"]  # Each span contains text, start, end, label, and score.
LabelPredicted spans
tur_LatnYeni sergiye · gitmeyi düşünüyoruz · girişte · yazıyor ama atölyeler için · gerekiyor · Çocuklara yönelik bölümde · var · bu yüzden · gitmek daha keyifli olabilir
deu_Latnnach der Arbeit · eine Anmeldung · mit der ganzen Familie
PUNCT; · . · - · , · .
eng_Latnfree admission · hands · on activities

Performance

Monolingual identification

Sentence-level language identification results comparing MixLID with eight baselines on FLORES+, WiLI-2018, UDHR, and CommonLID.

Each baseline and MixLID are evaluated on their shared language set; #L gives its label count. ACC is overall accuracy, and Macro F1 averages per-language F1. Scores are percentages, with the higher score in each comparison in bold. Comparison sets differ across baselines.

For fastText lid.176, CommonLingua, and Polyglot Tagger, script eligibility follows the evaluation mapping where explicit official script coverage is unavailable.

Mixed-language identification

Each cell reports ACC / Macro F1 (%). All models are evaluated on the same eligible tokens. Scores are computed per example and averaged within each language pair; Avg is the arithmetic mean across pairs. Non-language, mixed, and ambiguous reference labels, and tokens consisting only of whitespace, numbers, punctuation, or symbols, are excluded consistently.

ACS

Language pairCLD3MaskLIDPolyglot TaggerMixLID
Danish–English56.1 / 32.638.7 / 20.762.5 / 37.983.3 / 73.5
German–English56.4 / 33.935.9 / 22.978.2 / 62.098.0 / 96.9
Spanish–English48.2 / 28.222.9 / 15.374.6 / 56.996.1 / 94.1
French–English54.8 / 32.124.4 / 15.571.0 / 47.793.1 / 90.4
Indonesian–English31.7 / 18.419.3 / 12.138.0 / 24.292.1 / 89.1
Italian–English56.3 / 33.329.6 / 19.374.3 / 55.795.6 / 93.6
Dutch–English52.2 / 30.935.8 / 21.966.1 / 45.192.6 / 90.0
Swedish–English56.6 / 32.941.7 / 24.971.7 / 48.792.3 / 87.1
Turkish–German58.1 / 35.153.1 / 37.286.6 / 80.593.9 / 81.5
Turkish–English44.6 / 25.831.2 / 18.969.9 / 45.691.6 / 87.4
Chinese–English86.2 / 69.537.5 / 25.294.7 / 89.297.0 / 93.0
Avg54.6 / 33.933.6 / 21.371.6 / 53.993.2 / 88.8

CodeMixBench

Language pairCLD3MaskLIDPolyglot TaggerMixLID
German–English86.3 / 61.155.3 / 29.290.6 / 65.895.2 / 82.8
Spanish–English55.9 / 47.325.8 / 17.682.3 / 71.292.8 / 88.7
Chinese–English80.5 / 46.061.6 / 31.083.9 / 55.395.5 / 90.3
Avg74.2 / 51.547.6 / 25.985.6 / 64.194.5 / 87.3

Output format

FunctionReturns
predict_sentence(text)text, language, score
predict_tokens(text)text, tokens, spans
  • Tokens: subword predictions with text, start, end, label, and score.
  • Spans: consecutive predictions with the same label, merged across intervening ordinary spaces. These are language spans, not word segmentation.
  • Input language: majority vote over retained subword language predictions, excluding NUM, PUNCT, and SYM. Its score is the winning vote share, not a calibrated probability.
  • Offsets: zero-based character positions in the original Python string; end is exclusive. Input text is not normalized.

Special tokens, padding, and ordinary space-only ranges are omitted. Tabs and newlines retain model predictions. Empty input or input without language votes returns und with score 0; this is a helper fallback, not a classifier label. Token scores are softmax probabilities, and span scores average the constituent token scores.

Supported languages

MixLID predicts 111 language labels, listed below with their full names. Labels distinguish scripts where applicable; for example, Mandarin Chinese has separate simplified and traditional Chinese labels. The additional labels are NUM (numbers), PUNCT (punctuation), and SYM (symbols).

LanguageLabelLanguageLabel
Afrikaansafr_LatnMarathimar_Deva
Amharicamh_EthiModern Greekell_Grek
Arabicara_ArabNepalinpi_Deva
Armenianhye_ArmnNigerian Fulfuldefuv_Latn
Assameseasm_BengNorth Azerbaijaniazj_Latn
Bambarabam_LatnNorthern Uzbekuzn_Latn
Basqueeus_LatnNorwegian Bokmålnob_Latn
Bengaliben_BengNyanjanya_Latn
Bulgarianbul_CyrlOdiaory_Orya
Burmesemya_MymrPanjabipan_Guru
Catalancat_LatnParaguayan Guaranígug_Latn
Cebuanoceb_LatnPedinso_Latn
Central Khmerkhm_KhmrPersianfas_Arab
Central Kurdishckb_ArabPlateau Malagasyplt_Latn
Croatianhrv_LatnPolishpol_Latn
Czechces_LatnPortuguesepor_Latn
Danishdan_LatnRomanianron_Latn
Dutchnld_LatnRussianrus_Cyrl
Englisheng_LatnSerbiansrp_Cyrl
Filipinofil_LatnShanshn_Mymr
Finnishfin_LatnShonasna_Latn
Frenchfra_LatnSindhisnd_Arab
Gandalug_LatnSinhalasin_Sinh
Georgiankat_GeorSlovakslk_Latn
Germandeu_LatnSlovenianslv_Latn
Gujaratiguj_GujrSomalisom_Latn
Haitianhat_LatnSouthern Pashtopbt_Arab
Halh Mongoliankhk_CyrlSouthern Sothosot_Latn
Hausahau_LatnSpanishspa_Latn
Hebrewheb_HebrStandard Estonianekk_Latn
Hindihin_DevaStandard Latvianlvs_Latn
Hungarianhun_LatnStandard Malayzsm_Latn
Icelandicisl_LatnSundanesesun_Latn
Igboibo_LatnSwahiliswh_Latn
Ilokoilo_LatnSwatissw_Latn
Indonesianind_LatnSwedishswe_Latn
Italianita_LatnTajiktgk_Cyrl
Japanesejpn_JpanTamiltam_Taml
Javanesejav_LatnTelugutel_Telu
Kabuverdianukea_LatnThaitha_Thai
Kachinkac_LatnTibetanbod_Tibt
Kannadakan_KndaTigrinyatir_Ethi
Kazakhkaz_CyrlTosk Albanianals_Latn
Kinyarwandakin_LatnTsongatso_Latn
Kirghizkir_CyrlTswanatsn_Latn
Koreankor_HangTurkishtur_Latn
Laolao_LaooUkrainianukr_Cyrl
Lingalalin_LatnUrduurd_Arab
Lithuanianlit_LatnVietnamesevie_Latn
Luoluo_LatnWaraywar_Latn
Macedonianmkd_CyrlWest Central Oromogaz_Latn
Malayalammal_MlymWolofwol_Latn
Maltesemlt_LatnXhosaxho_Latn
Mandarin Chinesecmn_HansYorubayor_Latn
Mandarin Chinesecmn_HantZuluzul_Latn
Maorimri_Latn

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

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

GPU в ailist

Универсальный рантайм · transformers · token-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForTokenClassification
Ревизия весов
a3b4083

0 моделей