DerivedFunction / polyglot-tagger-v2.2

huggingface.co
Total runs: 29
24-hour runs: 0
7-day runs: -5
30-day runs: 17
Model's Last Updated: April 20 2026
token-classification

Introduction of polyglot-tagger-v2.2

Model Details of polyglot-tagger-v2.2

image

Fine-tuned xlm-roberta-base for sentence-level language tagging across 100 languages. The model predicts BIO-style language tags over tokens, which makes it useful for language identification, code-switch detection, and multilingual document analysis.

Compared to version 2.1, this version had training data that cleaned up mixed script training rows not in the target language, such as Arabic present in Cyrllic languages.

Model description

Introducing Polyglot Tagger, a new way to classify multi-lingual documents. By training specifically on token classification on individual sentences, the model generalizes well on a variety of languages, while also behaves as a multi-label classifier, and extracts sentences based on its language.

Intended uses & limitations

This model can be treated as a base model for further fine-tuning on specific language identification extraction tasks. Note that as a general language tagging model, it can potentially get confused from shared language families or from short texts. For example, Danish and Norwegian, Spanish and Portuguese, and Russian and Ukrainian.

The model is trained on a sentence with a minimum of four tokens, so it may not accurately classify very short and ambigous statements. Note that this model is experimental and may produce unexpected results compared to generic text classifiers. It is trained on cleaned text, therefore, "messy" text may unexpectedly produce different results.

Note that Romanized versions of any language may only have minor representation in the training set, such as Romanized Russian, and Hindi.

Training and Evaluation Data

A synthetic training row consists of 1-6 individual and mostly independent sentences extracted from various sources. To generalize well against multiple languages, several factors were used to simulate messy text, and to reduce single character bias on certain languages:

  • Low chance of deliberate accent stripping for languages such as Spanish and Portugeuse
  • Random chance to add in, replace or delete punctuation, numeric, and delimiter artifiacts
  • Insert same-script alphabets to family language. For example, randomly injecting Arabic characters in Arabic languages
  • Random chance to change the casing of compatible language scripts, such as Latin and Cyrllic.
  • Low chance of simulating OCR and messy text with character mutation.

To generalize well on both the target language and code switching a circulumn is provided:

  • Pure documents 55%: Single language to learn its vocabulary, simulating a short paragraph of a single language.
  • Homogenous 25%: Single language + one foreign sentence to learn simple code switching.
  • Spliced 10%: A foreign sentence is centered between two same-language sentence, with the first sentence's punctuation stripped, and second sentence's forced to be lowercased.
  • Mixed 10%: Generic mix of any languages.
Training Data Breakdown
lang train sentences train tokens eval sentences eval tokens all sentences all tokens
en 342138 (2.14%) 8515554 (1.58%) 2925 (3.89%) 29279 (1.57%) 345063 (2.14%) 8544833 (1.58%)
es 290248 (1.81%) 8250416 (1.53%) 1864 (2.48%) 19826 (1.06%) 292112 (1.82%) 8270242 (1.53%)
ru 289806 (1.81%) 7911565 (1.47%) 1963 (2.61%) 19501 (1.04%) 291769 (1.81%) 7931066 (1.47%)
ja 288677 (1.80%) 6935500 (1.29%) 1836 (2.44%) 20115 (1.08%) 290513 (1.81%) 6955615 (1.29%)
fr 285022 (1.78%) 8950594 (1.66%) 1849 (2.46%) 22785 (1.22%) 286871 (1.78%) 8973379 (1.66%)
zh 282136 (1.76%) 6585294 (1.22%) 1780 (2.37%) 17110 (0.92%) 283916 (1.76%) 6602404 (1.22%)
de 279766 (1.75%) 7421366 (1.38%) 1761 (2.34%) 20090 (1.08%) 281527 (1.75%) 7441456 (1.37%)
pt 277705 (1.73%) 7518951 (1.39%) 1789 (2.38%) 16872 (0.90%) 279494 (1.74%) 7535823 (1.39%)
it 274463 (1.71%) 7647936 (1.42%) 1641 (2.18%) 14284 (0.77%) 276104 (1.72%) 7662220 (1.42%)
uk 244679 (1.53%) 6480580 (1.20%) 1187 (1.58%) 9893 (0.53%) 245866 (1.53%) 6490473 (1.20%)
fi 243388 (1.52%) 5886670 (1.09%) 1521 (2.02%) 14613 (0.78%) 244909 (1.52%) 5901283 (1.09%)
ar 243319 (1.52%) 5055410 (0.94%) 1237 (1.65%) 18277 (0.98%) 244556 (1.52%) 5073687 (0.94%)
pl 239763 (1.50%) 6747779 (1.25%) 1162 (1.55%) 11588 (0.62%) 240925 (1.50%) 6759367 (1.25%)
he 235680 (1.47%) 6872873 (1.27%) 842 (1.12%) 7301 (0.39%) 236522 (1.47%) 6880174 (1.27%)
hu 234082 (1.46%) 6422364 (1.19%) 1093 (1.45%) 10598 (0.57%) 235175 (1.46%) 6432962 (1.19%)
tr 231785 (1.45%) 5649577 (1.05%) 1078 (1.43%) 9102 (0.49%) 232863 (1.45%) 5658679 (1.05%)
cs 229623 (1.43%) 6157905 (1.14%) 1010 (1.34%) 8638 (0.46%) 230633 (1.43%) 6166543 (1.14%)
nl 227744 (1.42%) 5208953 (0.97%) 1086 (1.45%) 9966 (0.53%) 228830 (1.42%) 5218919 (0.96%)
lt 220746 (1.38%) 5523460 (1.02%) 953 (1.27%) 8390 (0.45%) 221699 (1.38%) 5531850 (1.02%)
mk 219568 (1.37%) 6321823 (1.17%) 830 (1.10%) 7363 (0.39%) 220398 (1.37%) 6329186 (1.17%)
mr 218564 (1.36%) 5737670 (1.06%) 755 (1.00%) 6419 (0.34%) 219319 (1.36%) 5744089 (1.06%)
eo 214879 (1.34%) 5575371 (1.03%) 806 (1.07%) 9199 (0.49%) 215685 (1.34%) 5584570 (1.03%)
no 212572 (1.33%) 6119841 (1.13%) 1520 (2.02%) 46805 (2.51%) 214092 (1.33%) 6166646 (1.14%)
da 210913 (1.32%) 5244616 (0.97%) 1244 (1.66%) 11307 (0.61%) 212157 (1.32%) 5255923 (0.97%)
tl 198531 (1.24%) 5385091 (1.00%) 980 (1.30%) 11451 (0.61%) 199511 (1.24%) 5396542 (1.00%)
hy 197579 (1.23%) 6260512 (1.16%) 741 (0.99%) 14164 (0.76%) 198320 (1.23%) 6274676 (1.16%)
hi 196290 (1.23%) 7473616 (1.39%) 995 (1.32%) 43438 (2.33%) 197285 (1.23%) 7517054 (1.39%)
ko 196247 (1.23%) 6256562 (1.16%) 1021 (1.36%) 28154 (1.51%) 197268 (1.23%) 6284716 (1.16%)
el 192981 (1.21%) 7010969 (1.30%) 739 (0.98%) 17209 (0.92%) 193720 (1.20%) 7028178 (1.30%)
ro 185669 (1.16%) 6171646 (1.14%) 771 (1.03%) 21626 (1.16%) 186440 (1.16%) 6193272 (1.14%)
fa 182012 (1.14%) 5634518 (1.04%) 724 (0.96%) 21266 (1.14%) 182736 (1.14%) 5655784 (1.04%)
sk 181257 (1.13%) 5323589 (0.99%) 868 (1.16%) 30324 (1.62%) 182125 (1.13%) 5353913 (0.99%)
la 178735 (1.12%) 4452161 (0.83%) 752 (1.00%) 7803 (0.42%) 179487 (1.12%) 4459964 (0.82%)
bg 178477 (1.11%) 5772043 (1.07%) 681 (0.91%) 18306 (0.98%) 179158 (1.11%) 5790349 (1.07%)
is 174213 (1.09%) 6024579 (1.12%) 1005 (1.34%) 47601 (2.55%) 175218 (1.09%) 6072180 (1.12%)
be 174166 (1.09%) 6368950 (1.18%) 880 (1.17%) 30097 (1.61%) 175046 (1.09%) 6399047 (1.18%)
lv 170404 (1.06%) 5706364 (1.06%) 702 (0.93%) 35541 (1.90%) 171106 (1.06%) 5741905 (1.06%)
ckb 166543 (1.04%) 7530043 (1.40%) 591 (0.79%) 25103 (1.35%) 167134 (1.04%) 7555146 (1.40%)
ms 165285 (1.03%) 4430830 (0.82%) 778 (1.04%) 24919 (1.34%) 166063 (1.03%) 4455749 (0.82%)
kk 163582 (1.02%) 4925313 (0.91%) 629 (0.84%) 17536 (0.94%) 164211 (1.02%) 4942849 (0.91%)
ka 162558 (1.02%) 5244466 (0.97%) 527 (0.70%) 16440 (0.88%) 163085 (1.01%) 5260906 (0.97%)
bn 162058 (1.01%) 6155732 (1.14%) 416 (0.55%) 14535 (0.78%) 162474 (1.01%) 6170267 (1.14%)
eu 160479 (1.00%) 5375791 (1.00%) 675 (0.90%) 34708 (1.86%) 161154 (1.00%) 5410499 (1.00%)
as 160525 (1.00%) 8228319 (1.53%) 377 (0.50%) 20723 (1.11%) 160902 (1.00%) 8249042 (1.52%)
mn 160161 (1.00%) 5433430 (1.01%) 645 (0.86%) 19610 (1.05%) 160806 (1.00%) 5453040 (1.01%)
ur 158216 (0.99%) 5101965 (0.95%) 582 (0.77%) 19433 (1.04%) 158798 (0.99%) 5121398 (0.95%)
ky 157623 (0.98%) 4996516 (0.93%) 640 (0.85%) 18469 (0.99%) 158263 (0.98%) 5014985 (0.93%)
ba 157391 (0.98%) 7998542 (1.48%) 591 (0.79%) 30781 (1.65%) 157982 (0.98%) 8029323 (1.48%)
oc 157265 (0.98%) 5676181 (1.05%) 669 (0.89%) 25130 (1.35%) 157934 (0.98%) 5701311 (1.05%)
th 156439 (0.98%) 5222662 (0.97%) 579 (0.77%) 20033 (1.07%) 157018 (0.98%) 5242695 (0.97%)
hr 156094 (0.97%) 4838805 (0.90%) 716 (0.95%) 31608 (1.69%) 156810 (0.97%) 4870413 (0.90%)
af 155450 (0.97%) 4536957 (0.84%) 995 (1.32%) 29783 (1.60%) 156445 (0.97%) 4566740 (0.84%)
ps 155591 (0.97%) 4514560 (0.84%) 537 (0.71%) 15173 (0.81%) 156128 (0.97%) 4529733 (0.84%)
id 154998 (0.97%) 4010110 (0.74%) 737 (0.98%) 18766 (1.01%) 155735 (0.97%) 4028876 (0.74%)
pa 155053 (0.97%) 7277866 (1.35%) 602 (0.80%) 29831 (1.60%) 155655 (0.97%) 7307697 (1.35%)
sw 154323 (0.96%) 4695422 (0.87%) 562 (0.75%) 20760 (1.11%) 154885 (0.96%) 4716182 (0.87%)
tt 152959 (0.96%) 5329166 (0.99%) 642 (0.85%) 9018 (0.48%) 153601 (0.95%) 5338184 (0.99%)
jv 149846 (0.94%) 4508978 (0.84%) 512 (0.68%) 18744 (1.00%) 150358 (0.93%) 4527722 (0.84%)
cy 147138 (0.92%) 5344455 (0.99%) 664 (0.88%) 27600 (1.48%) 147802 (0.92%) 5372055 (0.99%)
ga 144559 (0.90%) 5145701 (0.95%) 681 (0.91%) 28351 (1.52%) 145240 (0.90%) 5174052 (0.96%)
bs 142871 (0.89%) 4246487 (0.79%) 664 (0.88%) 23293 (1.25%) 143535 (0.89%) 4269780 (0.79%)
ca 142813 (0.89%) 5286099 (0.98%) 614 (0.82%) 20417 (1.09%) 143427 (0.89%) 5306516 (0.98%)
kn 142453 (0.89%) 14440106 (2.68%) 636 (0.85%) 48433 (2.60%) 143089 (0.89%) 14488539 (2.68%)
ne 141617 (0.88%) 4633072 (0.86%) 441 (0.59%) 13357 (0.72%) 142058 (0.88%) 4646429 (0.86%)
gl 140293 (0.88%) 4370302 (0.81%) 580 (0.77%) 17719 (0.95%) 140873 (0.88%) 4388021 (0.81%)
ku 140150 (0.88%) 4681613 (0.87%) 539 (0.72%) 25315 (1.36%) 140689 (0.87%) 4706928 (0.87%)
uz 137971 (0.86%) 4402565 (0.82%) 512 (0.68%) 18239 (0.98%) 138483 (0.86%) 4420804 (0.82%)
sl 137474 (0.86%) 3689209 (0.68%) 602 (0.80%) 15975 (0.86%) 138076 (0.86%) 3705184 (0.68%)
sv 136227 (0.85%) 3888997 (0.72%) 951 (1.27%) 7503 (0.40%) 137178 (0.85%) 3896500 (0.72%)
tg 129047 (0.81%) 7212798 (1.34%) 507 (0.67%) 30575 (1.64%) 129554 (0.81%) 7243373 (1.34%)
et 125334 (0.78%) 3134904 (0.58%) 516 (0.69%) 13566 (0.73%) 125850 (0.78%) 3148470 (0.58%)
br 124276 (0.78%) 4304633 (0.80%) 555 (0.74%) 16741 (0.90%) 124831 (0.78%) 4321374 (0.80%)
su 123580 (0.77%) 3996363 (0.74%) 485 (0.65%) 18936 (1.01%) 124065 (0.77%) 4015299 (0.74%)
lb 123335 (0.77%) 4218363 (0.78%) 494 (0.66%) 18236 (0.98%) 123829 (0.77%) 4236599 (0.78%)
mt 122262 (0.76%) 6326484 (1.17%) 448 (0.60%) 23893 (1.28%) 122710 (0.76%) 6350377 (1.17%)
sr 121328 (0.76%) 3374324 (0.63%) 461 (0.61%) 4054 (0.22%) 121789 (0.76%) 3378378 (0.62%)
sq 114178 (0.71%) 3917105 (0.73%) 519 (0.69%) 17283 (0.93%) 114697 (0.71%) 3934388 (0.73%)
or 105680 (0.66%) 3746174 (0.69%) 415 (0.55%) 13597 (0.73%) 106095 (0.66%) 3759771 (0.69%)
ml 104847 (0.65%) 10467180 (1.94%) 432 (0.58%) 34289 (1.84%) 105279 (0.65%) 10501469 (1.94%)
yi 99296 (0.62%) 4037607 (0.75%) 356 (0.47%) 7656 (0.41%) 99652 (0.62%) 4045263 (0.75%)
te 96687 (0.60%) 9339722 (1.73%) 383 (0.51%) 32688 (1.75%) 97070 (0.60%) 9372410 (1.73%)
ta 89670 (0.56%) 7564484 (1.40%) 378 (0.50%) 25504 (1.37%) 90048 (0.56%) 7589988 (1.40%)
mg 89513 (0.56%) 3128095 (0.58%) 343 (0.46%) 11046 (0.59%) 89856 (0.56%) 3139141 (0.58%)
si 88038 (0.55%) 5030862 (0.93%) 345 (0.46%) 17895 (0.96%) 88383 (0.55%) 5048757 (0.93%)
rm 71273 (0.45%) 2704067 (0.50%) 254 (0.34%) 10060 (0.54%) 71527 (0.44%) 2714127 (0.50%)
vi 70788 (0.44%) 2476955 (0.46%) 333 (0.44%) 3428 (0.18%) 71121 (0.44%) 2480383 (0.46%)
gu 67542 (0.42%) 7557129 (1.40%) 299 (0.40%) 28080 (1.50%) 67841 (0.42%) 7585209 (1.40%)
bo 66467 (0.42%) 1308971 (0.24%) 218 (0.29%) 4357 (0.23%) 66685 (0.41%) 1313328 (0.24%)
ug 61389 (0.38%) 1398443 (0.26%) 213 (0.28%) 4674 (0.25%) 61602 (0.38%) 1403117 (0.26%)
dv 57776 (0.36%) 1485603 (0.28%) 205 (0.27%) 5705 (0.31%) 57981 (0.36%) 1491308 (0.28%)
am 56487 (0.35%) 2563835 (0.48%) 227 (0.30%) 11582 (0.62%) 56714 (0.35%) 2575417 (0.48%)
yo 56313 (0.35%) 3444596 (0.64%) 230 (0.31%) 18061 (0.97%) 56543 (0.35%) 3462657 (0.64%)
my 55960 (0.35%) 2062131 (0.38%) 212 (0.28%) 8300 (0.44%) 56172 (0.35%) 2070431 (0.38%)
km 53890 (0.34%) 2889004 (0.54%) 188 (0.25%) 9842 (0.53%) 54078 (0.34%) 2898846 (0.54%)
so 53862 (0.34%) 1963263 (0.36%) 202 (0.27%) 7961 (0.43%) 54064 (0.34%) 1971224 (0.36%)
sd 52494 (0.33%) 3075283 (0.57%) 200 (0.27%) 10379 (0.56%) 52694 (0.33%) 3085662 (0.57%)
zu 50081 (0.31%) 2287742 (0.42%) 187 (0.25%) 8913 (0.48%) 50268 (0.31%) 2296655 (0.42%)
lo 47982 (0.30%) 1659406 (0.31%) 188 (0.25%) 5980 (0.32%) 48170 (0.30%) 1665386 (0.31%)
ti 45884 (0.29%) 2804218 (0.52%) 193 (0.26%) 11862 (0.64%) 46077 (0.29%) 2816080 (0.52%)
ce 43040 (0.27%) 2319707 (0.43%) 181 (0.24%) 9398 (0.50%) 43221 (0.27%) 2329105 (0.43%)
ny 41897 (0.26%) 1969591 (0.37%) 159 (0.21%) 8122 (0.44%) 42056 (0.26%) 1977713 (0.37%)
gd 35576 (0.22%) 1240445 (0.23%) 142 (0.19%) 3449 (0.18%) 35718 (0.22%) 1243894 (0.23%)
xh 23590 (0.15%) 877812 (0.16%) 96 (0.13%) 3597 (0.19%) 23686 (0.15%) 881409 (0.16%)
om 14738 (0.09%) 523551 (0.10%) 55 (0.07%) 1935 (0.10%) 14793 (0.09%) 525486 (0.10%)
sco 8374 (0.05%) 224424 (0.04%) 30 (0.04%) 1055 (0.06%) 8404 (0.05%) 225479 (0.04%)
total 16012306 (100.00%) 539378202 (100.00%) 75126 (100.00%) 1866305 (100.00%) 16087432 (100.00%) 541244507 (100.00%)

This model is a fine-tuned version of xlm-roberta-base . It achieves the following results on the evaluation set:

  • Loss: 0.0345
  • Precision: 0.9508
  • Recall: 0.9647
  • F1: 0.9577
  • Accuracy: 0.9908
Training procedure
Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • train_batch_size: 18
  • eval_batch_size: 18
  • seed: 42
  • gradient_accumulation_steps: 8
  • total_train_batch_size: 144
  • optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: linear
  • num_epochs: 2
  • mixed_precision_training: Native AMP
Training results
Training Loss Epoch Step Validation Loss Precision Recall F1 Accuracy
0.3393 0.0804 2500 0.1078 0.7999 0.8817 0.8388 0.9723
0.3042 0.1609 5000 0.0910 0.8422 0.9054 0.8726 0.9766
0.2323 0.2413 7500 0.0859 0.8661 0.9174 0.8910 0.9766
0.2253 0.3218 10000 0.0707 0.8805 0.9266 0.9029 0.9818
0.2117 0.4022 12500 0.0715 0.8943 0.9284 0.9110 0.9805
0.1895 0.4827 15000 0.0582 0.8992 0.9372 0.9178 0.9843
0.1865 0.5631 17500 0.0557 0.9053 0.9381 0.9214 0.9851
0.1666 0.6436 20000 0.0560 0.9047 0.9424 0.9232 0.9852
0.1623 0.7240 22500 0.0588 0.9099 0.9405 0.9250 0.9838
0.1564 0.8045 25000 0.0476 0.9232 0.9489 0.9359 0.9872
0.1474 0.8849 27500 0.0525 0.9200 0.9483 0.9339 0.9855
0.1580 0.9654 30000 0.0455 0.9245 0.9502 0.9372 0.9878
0.1245 1.0458 32500 0.0447 0.9310 0.9536 0.9422 0.9881
0.1199 1.1262 35000 0.0445 0.9316 0.9547 0.9430 0.9881
0.1093 1.2067 37500 0.0432 0.9363 0.9559 0.9460 0.9886
0.1164 1.2871 40000 0.0410 0.9392 0.9583 0.9487 0.9895
0.1146 1.3676 42500 0.0433 0.9314 0.9562 0.9436 0.9886
0.0913 1.4480 45000 0.0434 0.9403 0.9585 0.9493 0.9894
0.1068 1.5285 47500 0.0397 0.9424 0.9608 0.9515 0.9897
0.0930 1.6089 50000 0.0388 0.9419 0.9605 0.9511 0.9898
0.0896 1.6894 52500 0.0371 0.9453 0.9623 0.9537 0.9901
0.0862 1.7698 55000 0.0362 0.9446 0.9624 0.9534 0.9903
0.0971 1.8503 57500 0.0355 0.9478 0.9635 0.9556 0.9908
0.0947 1.9307 60000 0.0345 0.9508 0.9647 0.9577 0.9908
Framework versions
  • Transformers 5.0.0
  • Pytorch 2.10.0+cu128
  • Datasets 4.0.0
  • Tokenizers 0.22.2

Runs of DerivedFunction polyglot-tagger-v2.2 on huggingface.co

29
Total runs
0
24-hour runs
1
3-day runs
-5
7-day runs
17
30-day runs

More Information About polyglot-tagger-v2.2 huggingface.co Model

More polyglot-tagger-v2.2 license Visit here:

https://choosealicense.com/licenses/mit

polyglot-tagger-v2.2 huggingface.co

polyglot-tagger-v2.2 huggingface.co is an AI model on huggingface.co that provides polyglot-tagger-v2.2's model effect (), which can be used instantly with this DerivedFunction polyglot-tagger-v2.2 model. huggingface.co supports a free trial of the polyglot-tagger-v2.2 model, and also provides paid use of the polyglot-tagger-v2.2. Support call polyglot-tagger-v2.2 model through api, including Node.js, Python, http.

DerivedFunction polyglot-tagger-v2.2 online free

polyglot-tagger-v2.2 huggingface.co is an online trial and call api platform, which integrates polyglot-tagger-v2.2's modeling effects, including api services, and provides a free online trial of polyglot-tagger-v2.2, you can try polyglot-tagger-v2.2 online for free by clicking the link below.

DerivedFunction polyglot-tagger-v2.2 online free url in huggingface.co:

https://huggingface.co/DerivedFunction/polyglot-tagger-v2.2

polyglot-tagger-v2.2 install

polyglot-tagger-v2.2 is an open source model from GitHub that offers a free installation service, and any user can find polyglot-tagger-v2.2 on GitHub to install. At the same time, huggingface.co provides the effect of polyglot-tagger-v2.2 install, users can directly use polyglot-tagger-v2.2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

polyglot-tagger-v2.2 install url in huggingface.co:

https://huggingface.co/DerivedFunction/polyglot-tagger-v2.2

Url of polyglot-tagger-v2.2

Provider of polyglot-tagger-v2.2 huggingface.co

DerivedFunction
ORGANIZATIONS

Other API from DerivedFunction