Loading…
Loading…
[!WARNING] THIS PROJECT HAS BEEN ARCHIVED.
This project and its associated code on GitHub are no longer under active development or maintained.
This model is a conversion of unitary/unbiased-toxic-roberta to ONNX format using the 🤗 Optimum library.
Trained models & code to predict toxic comments on 3 Jigsaw challenges: Toxic comment classification, Unintended Bias in Toxic comments, Multilingual toxic comment classification.
Built by Laura Hanu at Unitary.
⚠️ Disclaimer: The huggingface models currently give different results to the detoxify library (see issue here).
All challenges have a toxicity label. The toxicity labels represent the aggregate ratings of up to 10 annotators according the following schema:
More information about the labelling schema can be found here.
This challenge includes the following labels:
toxicsevere_toxicobscenethreatinsultidentity_hateThis challenge has 2 types of labels: the main toxicity labels and some additional identity labels that represent the identities mentioned in the comments.
Only identities with more than 500 examples in the test set (combined public and private) are included during training as additional labels and in the evaluation calculation.
toxicitysevere_toxicityobscenethreatinsultidentity_attacksexual_explicitIdentity labels used:
malefemalehomosexual_gay_or_lesbianchristianjewishmuslimblackwhitepsychiatric_or_mental_illnessA complete list of all the identity labels available can be found here.
Loading the model requires the 🤗 Optimum library installed.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("laiyer/unbiased-toxic-roberta-onnx")
model = ORTModelForSequenceClassification.from_pretrained("laiyer/unbiased-toxic-roberta-onnx")
classifier = pipeline(
task="text-classification",
model=model,
tokenizer=tokenizer,
)
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!