Downloads · 30 days
28
1% of all-time downloads
marianna13/xlm-roberta-fine-tuned-on-russian-abusive-language
xlm-roberta-fine-tuned-on-russian-abusive-language is a text classification model from marianna13. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
28
1% of all-time downloads
All-time downloads
2.3K
Public
Repo size
10.1 GB
Likes
0
Public
Click a slice to open those files.
.bin1.1 GB · 98%
From the Hugging Face model README
from transformers import pipeline
model_path = 'marianna13/xlm-roberta-fine-tuned-on-russian-abusive-language'
id2label = {
0:'неопасный тескт',
1:'опасный тескт'
}
label2id = {
'неопасный тескт':0,
'опасный тескт':1
}
config = AutoConfig.from_pretrained(model_path, id2label=id2label, label2id=label2id)
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path, config=config)
text = "Прекрасный день."
pipe = pipeline('text-classification', model=model, tokenizer=tokenizer)
pipe(text)
[{'label': 'неопасный текcт', 'score': 0.9249424934387207}]