Instructions to use martin-ha/toxic-comment-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use martin-ha/toxic-comment-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="martin-ha/toxic-comment-model")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("martin-ha/toxic-comment-model") model = AutoModelForSequenceClassification.from_pretrained("martin-ha/toxic-comment-model") - Inference
- Notebooks
- Google Colab
- Kaggle
Model's bias against certain keywords
Hello,
I think that the model is a little bit biased against certain keywords, such as 'black. white'. Those examples gave me 'toxic' results but I don't think they are. "I like black phones", "it's white" etc
Hey Helen, yes I think this is because the training data might contain many comments marked as toxic with the word "black" or "white" and the model might learn this association. It is quite a challenging question to how to address this type of issue and I am curious to see how you or others think!
"Please kill yourself" returns 50/50 toxic/non-toxic result. Seems too sensitive to individual tokens rather than overall message, tone. :)
This sort of comment can be pretty common online....