/ Модель

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

Размер весов
1,2 ГБ
Лицензия
GPL 3.0
Библиотека
fasttext
Опубликована
12 ноя 2024

OpenLID-v2

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

OpenLID-v2 — модель fastText для автоматического определения языка текста.

425скачиваний за 30 дней8лайковвеса обновлены17 окт 2025

Бенчмарки

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

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

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

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

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

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

OpenLID-v2 — модель классификации текста для автоматического определения языка. Её разработали Laurie Burchell, Alexandra Birch, Nikolay Bogoychev и Kenneth Heafield; она представляет собой улучшенную версию OpenLID и использует библиотеку fastText. В README модель описана как высокопроизводительная и охватывающая широкий набор языков.

Модель подходит для определения языка коротких текстов и строк, например для маршрутизации запросов по языку, предварительной сортировки корпусов и добавления языковых меток к пользовательскому контенту. В карточке указано NLP-язык en, а репозиторий связан с датасетом OpenLID-v2. Лицензия — GPL-3.0.

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

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

Ограничения

README отмечает зависимость fastText от NumPy. Поддержка языков описана как широкая, но точный перечень языков и количественные показатели качества в предоставленных данных отсутствуют.

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

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

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

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

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

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

Открыть на Hugging Face

OpenLID-v2

  • Developed by: Laurie Burchell, Alexandra Birch, Nikolay Bogoychev, Kenneth Heafield
  • Model type: Text classification (language identification)
  • Language(s) (NLP): en
  • License: gpl-3.0
  • Resources for more information: OpenLID paper

Model description

OpenLID-v2 is a high-coverage, high-performance language identification model. It is an improved version of OpenLID.

The original model and training data are described in Burchell et al. (2023). The changes made to produce OpenLID-v2 are described in the OpenLID-v2 dataset repo.

How to use

[!WARNING]
fasttext requires numpy <2.0

Here is how to use this model to detect the language of a given text. For best results, text should be cleaned and normalised with openlid_normer.clean_line prior to classification.

>>> import fasttext
>>> from openlid_normer import clean_line
>>> from huggingface_hub import hf_hub_download

>>> model_path = hf_hub_download(repo_id="laurievb/OpenLID-v2", filename="model.bin")
>>> model = fasttext.load_model(model_path)
>>> input_text = clean_line("Hello, world!")
>>> model.predict(input_text)

(('__label__eng_Latn',), array([0.81148803]))

>>> # lower score for eng_Latn without cleaning
>>> model.predict("Hello, world!", k=5)  

(('__label__eng_Latn', '__label__vie_Latn', '__label__nld_Latn', '__label__pol_Latn', '__label__deu_Latn'), 
 array([0.61224753, 0.21323682, 0.09696738, 0.01359863, 0.01319415]))

Limitations and bias

The dataset and model cover 200 language varieties. However, some language varieties (e.g. Arabic dialects) are very hard to distinguish and in practice, it may only be possible to classify a input at the macrolanguage level.

The FLORES+ test set consists of sentences from a single domain (wiki articles), and so performance on this test set may not reflect how well our classifier works in other domains.

Our work aims to broaden NLP coverage by allowing practitioners to identify relevant data in more languages. However, we note that LID is inherently a normative activity that risks excluding minority dialects, scripts, or entire microlanguages from a macrolanguage. Choosing which languages to cover may reinforce power imbalances, as only some groups gain access to NLP technologies. In addition, errors in LID can have a significant impact on downstream performance, particularly (as is often the case) when a system is used as a ‘black box’. The performance of our classifier is not equal across languages which could lead to worse downstream performance for particular groups. We mitigate this by providing metrics by class.

Training data

The model was trained on the OpenLID-v2 dataset. The data was normalised and classes were up/downsampled with temperature sampling prior to training; code to do this can be found in the scripts directory in the OpenLID-v2 dataset repository.

Training procedure

The model was trained using fastText with the following hyperparameters set. All other hyperparameters were set to their default values.

  • loss: softmax
  • epochs: 2
  • learning rate: 0.8
  • minimum number of word occurances: 1000
  • embedding dimension: 256
  • character n-grams: 2-5
  • word n-grams: 1
  • bucket size: 1,000,000
  • threads: 68

Evaluation datasets

We evaluate the model using the FLORES+ evaluation benchmark, normalising text prior to classification with openlid_normer.clean_line. Full results are available below.

The original OpenLID model was evaluated using the FLORES-200 benchmark provided by Costa-jussà et al. (2022), with further information available in the OpenLID paper.

BibTeX entry and citation info

ACL citation (preferred)

@inproceedings{burchell-etal-2023-open,
    title = "An Open Dataset and Model for Language Identification",
    author = "Burchell, Laurie  and
      Birch, Alexandra  and
      Bogoychev, Nikolay  and
      Heafield, Kenneth",
    editor = "Rogers, Anna  and
      Boyd-Graber, Jordan  and
      Okazaki, Naoaki",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.acl-short.75",
    doi = "10.18653/v1/2023.acl-short.75",
    pages = "865--879",
    abstract = "Language identification (LID) is a fundamental step in many natural language processing pipelines. However, current LID systems are far from perfect, particularly on lower-resource languages. We present a LID model which achieves a macro-average F1 score of 0.93 and a false positive rate of 0.033{\%} across 201 languages, outperforming previous work. We achieve this by training on a curated dataset of monolingual data, which we audit manually to ensure reliability. We make both the model and the dataset available to the research community. Finally, we carry out detailed analysis into our model{'}s performance, both in comparison to existing open models and by language class.",
}

Evaluation results

Language codeLines of dataF1 score
ace_Arab63600.971029
ace_Latn168450.998517
acm_Arab54550.025121
acq_Arab18310.001974
aeb_Arab205410.488032
afr_Latn10328660.999012
als_Latn3413721.0
amh_Ethi8109890.999506
apc_Arab972930.386029
arb_Arab71006460.33617
ars_Arab257710.025373
ary_Arab273760.579467
arz_Arab698320.481471
asm_Beng1212421.0
ast_Latn649980.991605
awa_Deva84250.655352
ayr_Latn1400861.0
azb_Arab108010.915957
azj_Latn4575990.998026
bak_Cyrl635531.0
bam_Latn93890.619494
ban_Latn152020.977353
bel_Cyrl838591.0
bem_Latn3783010.979612
ben_Beng4919420.996032
bho_Deva536660.904134
bjn_Arab62890.968215
bjn_Latn202640.985665
bod_Tibt24680.854072
bos_Latn1960050.69401
bug_Latn74950.99504
bul_Cyrl5961201.0
cat_Latn1137450.99802
ceb_Latn9919570.998519
ces_Latn4243030.998026
cjk_Latn356450.928159
ckb_Arab249890.999506
cmn_Hans10430000.986693
cmn_Hant20115850.89396
crh_Latn173980.992541
cym_Latn972641.0
dan_Latn24609650.989066
deu_Latn6528831.0
dik_Latn258330.999011
dyu_Latn168610.053309
dzo_Tibt69030.886842
ekk_Latn29846410.999506
ell_Grek29771150.999506
eng_Latn75147700.990206
epo_Latn3328950.999506
eus_Latn6135641.0
ewe_Latn5781810.998028
fao_Latn383780.997036
fij_Latn3552851.0
fil_Latn11784640.999013
fin_Latn22999001.0
fon_Latn308950.99802
fra_Latn5860640.99703
fur_Latn539800.999506
fuv_Latn139210.98191
gaz_Latn3314301.0
gla_Latn492180.999506
gle_Latn1957911.0
glg_Latn415820.994557
gug_Latn788800.99852
guj_Gujr8349181.0
hat_Latn2940420.992643
hau_Latn3402630.989247
heb_Hebr9873050.999506
hin_Deva10713320.799519
hne_Deva525360.927026
hrv_Latn7855630.741921
hun_Latn25592160.999506
hye_Armn3575781.0
ibo_Latn4843630.999013
ilo_Latn9663610.995573
ind_Latn16828980.925908
isl_Latn433320.998519
ita_Latn4783580.995547
jav_Latn643770.988235
jpn_Jpan8866380.99852
kab_Latn507720.829508
kac_Latn111561.0
kam_Latn512650.866741
kan_Knda3554271.0
kas_Arab62250.979324
kas_Deva67380.968925
kat_Geor4120721.0
kaz_Cyrl506430.999506
kbp_Latn523821.0
kea_Latn55050.965764
khk_Cyrl1665051.0
khm_Khmr757130.999506
kik_Latn941160.963281
kin_Latn4398560.799766
kir_Cyrl3668401.0
kmb_Latn903140.95809
kmr_Latn150840.997041
knc_Arab63370.702564
knc_Latn62540.998516
kor_Hang3509451.0
ktu_Latn2063250.985352
lao_Laoo247121.0
lij_Latn274540.997531
lim_Latn474900.994563
lin_Latn5381300.997041
lit_Latn23604620.999506
lmo_Latn332880.99505
ltg_Latn142030.997033
ltz_Latn368100.999506
lua_Latn2887140.996536
lug_Latn2452160.995569
luo_Latn1347770.998517
lus_Latn1916170.99802
lvs_Latn25335010.997531
mag_Deva63300.966281
mai_Deva330930.988574
mal_Mlym3780201.0
mar_Deva10061840.997536
min_Latn310470.995547
mkd_Cyrl3930810.999506
mlt_Latn20110020.996063
mni_Beng470760.996063
mos_Latn1932190.976227
mri_Latn477360.999506
mya_Mymr5471131.0
nld_Latn26096420.994573
nno_Latn981760.980779
nob_Latn17497130.971935
npi_Deva2295950.995069
nso_Latn5524040.989237
nus_Latn62941.0
nya_Latn7800660.994106
oci_Latn2397370.997289
ory_Orya924751.0
pag_Latn2871790.998024
pan_Guru3542361.0
pap_Latn3973550.978703
pbt_Arab2763720.997041
pes_Arab28102680.662182
plt_Latn470521.0
pol_Latn30357670.996553
por_Latn36239500.992134
prs_Arab310380.577474
quy_Latn1520021.0
ron_Latn4363110.998028
run_Latn4548870.850575
rus_Cyrl66884841.0
sag_Latn2515620.999506
san_Deva460560.990524
sat_Olck290331.0
scn_Latn392330.996059
shn_Mymr221871.0
sin_Sinh4239661.0
slk_Latn28159710.999012
slv_Latn26840500.997044
smo_Latn3619690.998519
sna_Latn7549010.995084
snd_Arab479010.998026
som_Latn1879660.998028
sot_Latn19410.963115
spa_Latn6766350.993083
srd_Latn460370.997531
srp_Cyrl3080750.999506
ssw_Latn1122370.989537
sun_Latn463370.993076
swe_Latn24295471.0
swh_Latn2263770.92972
szl_Latn321770.996533
tam_Taml5500901.0
taq_Latn102620.731371
taq_Tfng62900.959677
tat_Cyrl2535161.0
tel_Telu2762621.0
tgk_Cyrl1317081.0
tha_Thai7283131.0
tir_Ethi4734700.999506
tpi_Latn4575440.999011
tsn_Latn7750660.974458
tso_Latn7472260.9941
tuk_Latn1576101.0
tum_Latn2331360.994584
tur_Latn5988190.992636
twi_Latn5384210.998516
uig_Arab819401.0
ukr_Cyrl11238121.0
umb_Latn2156400.983655
urd_Arab4872650.98062
uzn_Latn14639250.99852
vec_Latn417460.995074
vie_Latn8649790.999506
war_Latn2782651.0
wol_Latn269850.996047
xho_Latn9072810.985309
ydd_Hebr9230.999506
yor_Latn5244930.996553
yue_Hant593480.874099
zgh_Tfng94850.96124
zsm_Latn4013370.954902
zul_Latn9413010.970106

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

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

GPU в ailist

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

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

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

Ревизия весов
10b538e

0 моделей