Downloads · 30 days
21
4% of all-time downloads
prabhaskenche/toxic-comment-classification-using-RoBERTa
toxic-comment-classification-using-RoBERTa is a text classification model from prabhaskenche. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as afl-3.0.
This project provides a toxic comment classification model based on RoBERTa (Robustly optimized BERT approach). The model is designed to classify comments as toxic or non-toxic, helping in moderating online discussion…
Downloads · 30 days
21
4% of all-time downloads
All-time downloads
577
Public
Parameters
355M
2.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin1.4 GB · 50%
From the Hugging Face model README
This project provides a toxic comment classification model based on RoBERTa (Robustly optimized BERT approach). The model is designed to classify comments as toxic or non-toxic, helping in moderating online discussions and improving community interactions.
pytorch_model.bin: The trained model weights.config.json: Model configuration file.merges.txt: BPE tokenizer merges file.model.safetensors: Model weights in safetensors format.special_tokens_map.json: Tokenizer special tokens mapping.tokenizer_config.json: Tokenizer configuration file.vocab.json: Tokenizer vocabulary file.roberta-toxic-comment-classifier.pkl: Serialized best model state dictionary (for PyTorch).README.md: This documentation file.from transformers import pipeline
# Load the model and tokenizer
model_name = "prabhaskenche/pk-toxic-comment-classification-using-RoBERTa"
classifier = pipeline("text-classification", model=model_name)
# Example usage
text = "You're the worst person I've ever met."
result = classifier(text)
print(result)
Install the required packages:
pip install torch transformers sklearn