alt.freeweights.vision / xlm-roberta-base-language-detection-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.visionSubject:

xlm-roberta-base-language-detection-ONNX

Date: 2026-11-15Commit: 919c87aSigned: 2DC28CC7B26A283B ✓

Text classification model. Onnx weights, 4.61 GB in all. Published by onnx-community under MIT.

vision4.61GBxlm-roberta-base-language-detection-ONNXonnxpermissive
FactsParamsnot statedSize4.61 GBFormatsonnxTasktext classificationLicenseMITFrom sourcepermissive
$ fw get onnx-community/xlm-roberta-base-language-detection-ONNX
# manifest sha256 7f3305e63726… · 4.61 GB · 14 files
$ fw verify ./xlm-roberta-base-language-detection-ONNX onnx-community/xlm-roberta-base-language-detection-ONNX
From sourceHosted (signed)onnx-community/xlm-roberta-base-language-detection-ONNXLast check: 2026-11-15 05:17 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of xlm-roberta-base-language-detection.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Scan with

Overview

Size
4.61 GB
Weights
279 MB (smallest of 8 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text classification
License
MIT (permissive)
Files
14, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Base model: papluca/xlm-roberta-base-language-detection

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 05:17 UTCpassed

Model card

From the publisher at commit 919c87a. Shown as plain text with links; images open at the publisher.

xlm-roberta-base-language-detection (ONNX)#

This is an ONNX version of papluca/xlm-roberta-base-language-detection. It was automatically converted and uploaded using this Hugging Face Space.

Usage with Transformers.js#

See the pipeline documentation for text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline


xlm-roberta-base-language-detection#

This model is a fine-tuned version of xlm-roberta-base on the Language Identification dataset.

Model description#

This model is an XLM-RoBERTa transformer model with a classification head on top (i.e. a linear layer on top of the pooled output). For additional information please refer to the xlm-roberta-base model card or to the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al.

Intended uses & limitations#

You can directly use this model as a language detector, i.e. for sequence classification tasks. Currently, it supports the following 20 languages:

arabic (ar), bulgarian (bg), german (de), modern greek (el), english (en), spanish (es), french (fr), hindi (hi), italian (it), japanese (ja), dutch (nl), polish (pl), portuguese (pt), russian (ru), swahili (sw), thai (th), turkish (tr), urdu (ur), vietnamese (vi), and chinese (zh)

Training and evaluation data#

The model was fine-tuned on the Language Identification dataset, which consists of text sequences in 20 languages. The training set contains 70k samples, while the validation and test sets 10k each. The average accuracy on the test set is 99.6% (this matches the average macro/weighted F1-score being the test set perfectly balanced). A more detailed evaluation is provided by the following table.

LanguagePrecisionRecallF1-scoresupport
ar0.9980.9960.997500
bg0.9980.9640.981500
de0.9980.9960.997500
el0.9961.0000.998500
en1.0001.0001.000500
es0.9671.0000.983500
fr1.0001.0001.000500
hi0.9940.9920.993500
it1.0000.9920.996500
ja0.9960.9960.996500
nl1.0001.0001.000500
pl1.0001.0001.000500
pt0.9881.0000.994500
ru1.0000.9940.997500
sw1.0001.0001.000500
th1.0000.9980.999500
tr0.9940.9920.993500
ur1.0001.0001.000500
vi0.9921.0000.996500
zh1.0001.0001.000500
Benchmarks#

As a baseline to compare xlm-roberta-base-language-detection against, we have used the Python langid library. Since it comes pre-trained on 97 languages, we have used its .set_languages() method to constrain the language set to our 20 languages. The average accuracy of langid on the test set is 98.5%. More details are provided by the table below.

LanguagePrecisionRecallF1-scoresupport
ar0.9900.9700.980500
bg0.9980.9640.981500
de0.9920.9440.967500
el1.0000.9980.999500
en1.0001.0001.000500
es1.0000.9680.984500
fr0.9961.0000.998500
hi0.9490.9760.963500
it0.9900.9800.985500
ja0.9270.9880.956500
nl0.9801.0000.990500
pl0.9860.9960.991500
pt0.9500.9960.973500
ru0.9960.9740.985500
sw1.0001.0001.000500
th1.0000.9960.998500
tr0.9900.9680.979500
ur0.9980.9960.997500
vi0.9710.9900.980500
zh1.0001.0001.000500

How to get started with the model#

The easiest way to use the model is via the high-level pipeline API:

from transformers import pipeline

text = [
    "Brevity is the soul of wit.",
    "Amor, ch'a nullo amato amar perdona."
]

model_ckpt = "papluca/xlm-roberta-base-language-detection"
pipe = pipeline("text-classification", model=model_ckpt)
pipe(text, top_k=1, truncation=True)

Or one can proceed with the tokenizer and model separately:

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

text = [
    "Brevity is the soul of wit.",
    "Amor, ch'a nullo amato amar perdona."
]

model_ckpt = "papluca/xlm-roberta-base-language-detection"
tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
model = AutoModelForSequenceClassification.from_pretrained(model_ckpt)

inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

preds = torch.softmax(logits, dim=-1)

# Map raw predictions to languages
id2lang = model.config.id2label
vals, idxs = torch.max(preds, dim=1)
{id2lang[k.item()]: v.item() for k, v in zip(idxs, vals)}

Training procedure#

Fine-tuning was done via the Trainer API. Here is the Colab notebook with the training code.

Training hyperparameters#

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 64
  • eval_batch_size: 128
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 2
  • mixed_precision_training: Native AMP
Training results#

The validation results on the valid split of the Language Identification dataset are summarised here below.

Training LossEpochStepValidation LossAccuracyF1
0.24921.010940.01490.99690.9969
0.01012.021880.01030.99770.9977

In short, it achieves the following results on the validation set:

  • Loss: 0.0101
  • Accuracy: 0.9977
  • F1: 0.9977
Framework versions#
  • Transformers 4.12.5
  • Pytorch 1.10.0+cu111
  • Datasets 1.15.1
  • Tokenizers 0.10.3

Files

14 files · 4.61 GBWeights 279 MB (smallest of 8 ONNX variants). Sizes and sha256 from the signed manifest.
Hide all 14 files with their sha256
FileSizesha256
.gitattributes1.57 KB34448b82c17d60fec9b65b1f093c115ddbaadc04beb1b0140b6bfed2e012a930
README.md7.81 KB00e107c5e0cd3c85e3e6aacb6b7fd63931301356c3c5ab16310686cf30cab1f1
config.json1.34 KB99c57e992a6219715174b31ed45ee07b54c1e08533a88e5cf4ebfe2f4fd032b1
onnx/model.onnx1.11 GB15ef7f8c637af7e95cf4f7c29dd354c06aed0b72c47da83f9281e58b77eaf621
onnx/model_bnb4.onnx826 MB82d7a4a7ca352813577804efedd326b8360846ba285200be3502f093a758bb33
onnx/model_fp16.onnx556 MB737de4df318955c4d0ecc9f7303844ed6b77d0f22662cba4e2be52a7d3224a60
onnx/model_int8.onnx279 MBe3a2f1b44ea6a76683e4655127531b05c6b568fe643bd39bddf7f7c62ab182c9
onnx/model_q4.onnx826 MB82d7a4a7ca352813577804efedd326b8360846ba285200be3502f093a758bb33
onnx/model_q4f16.onnx434 MBab5cd7bfa33493c37526027388bdd001111353d0349b73a758640a6b1305f859
onnx/model_quantized.onnx279 MBe3a2f1b44ea6a76683e4655127531b05c6b568fe643bd39bddf7f7c62ab182c9
onnx/model_uint8.onnx279 MB5f469c14e9ec8159c921ac8fe33b01fdf877c286acdb3cb33033001ad7969212
special_tokens_map.json964 B8c785abebea9ae3257b61681b4e6fd8365ceafde980c21970d001e834cf10835
tokenizer.json17.1 MB3a56def25aa40facc030ea8b0b87f3688e4b3c39eb8b45d5702b3a1300fe2a20
tokenizer_config.json1.18 KBccf223ba3d5b3cc7fa6c3bf451f3bb40557a5c92b0aa33f63d17802ff1a96fd9
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
919c87aa27 pinned now2026-11-15 05:17 UTC14 files · 4.61 GB

Use it

$ fw get onnx-community/xlm-roberta-base-language-detection-ONNX
# manifest sha256 7f3305e63726… · 4.61 GB · 14 files
$ fw verify ./xlm-roberta-base-language-detection-ONNX onnx-community/xlm-roberta-base-language-detection-ONNX
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/xlm-roberta-base-language-detection-ONNX.json --dir ./xlm-roberta-base-language-detection-ONNX $ python3 fw.py verify ./xlm-roberta-base-language-detection-ONNX ./onnx-community__xlm-roberta-base-language-detection-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/xlm-roberta-base-language-detection-ONNX --revision 919c87aa2749131ae1ab709931a16bf1cc9774ea --local-dir ./xlm-roberta-base-language-detection-ONNX

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
00e107c5e0cd3c85e3e6aacb6b7fd63931301356c3c5ab16310686cf30cab1f1
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.visionSubject: xlm-roberta-base-language-detection-ONNXDate: 2026-11-15Commit: 919c87aSigned: 2DC28CC7B26A283B ✓
Upstream
onnx-community/xlm-roberta-base-language-detection-ONNX
Pinned commit
919c87aa2749131ae1ab709931a16bf1cc9774ea
Manifest
xlm-roberta-base-language-detection-ONNX.json · .minisig
Manifest sha256
7f3305e63726a0c4b84db32110654eee5dc7a15d24bb7fe0c12f49c693da5c3c
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:17 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/xlm-roberta-base-language-detection-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/xlm-roberta-base-language-detection-ONNX.json.minisig $ minisign -Vm xlm-roberta-base-language-detection-ONNX.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

papluca/xlm-roberta-base-language-detection · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/xlm-roberta-base-language-detection-ONNX
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. xlm-roberta-base-language-detection-ONNX.json. Provenance. Takedown history: none.
From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX