tarekziade/profanity
Viewer • Updated • 184k • 39 • 2
How to use tarekziade/pardonmyai with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="tarekziade/pardonmyai") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("tarekziade/pardonmyai")
model = AutoModelForSequenceClassification.from_pretrained("tarekziade/pardonmyai", device_map="auto")Fine-tuned model that detects profanity in text.
Inspired from https://victorzhou.com/blog/better-profanity-detection-with-scikit-learn/
The model was trained with the dataset from that project.
Usage example with Python:
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="tarekziade/pardonmyai")
print(classifier("These are beautiful flowers"))
Usage example with Transformers.js:
import { pipeline } from '@xenova/transformers';
let pipe = await pipeline('sentiment-analysis', model='tarekziade/pardonmyai');
let out = await pipe('These are beautiful flowers');
Source code and data: https://github.com/tarekziade/pardonmyai
metrics:
There's a tiny version available: https://huggingface.co/tarekziade/pardonmyai-tiny