Views
No views yet
[!WARNING] THIS PROJECT HAS BEEN ARCHIVED.This project and its associated code on GitHub are no longer under active development or maintained.
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)1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import AutoTokenizer, pipeline
3
4
5tokenizer = AutoTokenizer.from_pretrained("laiyer/xlm-roberta-base-language-detection-onnx")
6model = ORTModelForSequenceClassification.from_pretrained("laiyer/xlm-roberta-base-language-detection-onnx")
7classifier = pipeline(
8 task="text-classification",
9 model=model,
10 tokenizer=tokenizer,
11 top_k=None,
12)
13
14classifier_output = ner("It's not toxic comment")
15print(classifier_output)