Downloads · 30 days
9
6% of all-time downloads
dnouv/xlm-roberta-base-language-detection-tfjs
xlm-roberta-base-language-detection-tfjs is a text classification model from dnouv. Use it when you need a label for a piece of text. The card lists the license as mit.
This model is a conversion of papluca/xlm-roberta-base-language-detection to ONNX format using the 🤗 Optimum library.
Downloads · 30 days
9
6% of all-time downloads
All-time downloads
162
Public
Repo size
2.5 GB
Likes
1
Public
Click a slice to open those files.
.onnx2.5 GB · 99%
From the Hugging Face model README
This model is a conversion of papluca/xlm-roberta-base-language-detection to ONNX format using the 🤗 Optimum library.
This model is a fine-tuned version of xlm-roberta-base on the Language Identification dataset.
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.
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)
Loading the model requires the 🤗 Optimum library installed.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("laiyer/xlm-roberta-base-language-detection-onnx")
model = ORTModelForSequenceClassification.from_pretrained("laiyer/xlm-roberta-base-language-detection-onnx")
classifier = pipeline(
task="text-classification",
model=model,
tokenizer=tokenizer,
top_k=None,
)
classifier_output = ner("It's not toxic comment")
print(classifier_output)
Join our Slack to give us feedback, connect with the maintainers and fellow users, ask questions, or engage in discussions about LLM security!
<a href="https://join.slack.com/t/laiyerai/shared_invite/zt-28jv3ci39-sVxXrLs3rQdaN3mIl9IT~w"><img src="https://github.com/laiyer-ai/llm-guard/blob/main/docs/assets/join-our-slack-community.png?raw=true" width="200"></a>