Downloads · 30 days
61
0% of all-time downloads
IlyaGusev/rubertconv_toxic_editor
rubertconv_toxic_editor is a token classification model from IlyaGusev. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
Tagging model for detoxification based on rubert-base-cased-conversational.
Downloads · 30 days
61
0% of all-time downloads
All-time downloads
20.4K
Public
Repo size
1.4 GB
Likes
13
Public
Click a slice to open those files.
.bin709 MB · 99%
From the Hugging Face model README
Tagging model for detoxification based on rubert-base-cased-conversational.
4 possible classes:
Use in pair with mask filler.
Colab: link
import torch
from transformers import AutoTokenizer, pipeline
tagger_model_name = "IlyaGusev/rubertconv_toxic_editor"
device = "cuda" if torch.cuda.is_available() else "cpu"
device_num = 0 if device == "cuda" else -1
tagger_pipe = pipeline(
"token-classification",
model=tagger_model_name,
tokenizer=tagger_model_name,
framework="pt",
device=device_num,
aggregation_strategy="max"
)
text = "..."
tagger_predictions = tagger_pipe([text], batch_size=1)
sample_predictions = tagger_predictions[0]
print(sample_predictions)
TBA