Run this model with HF Jobs

Run tum-nlp/bert-hateXplain on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/tum-nlp/bert-hateXplain. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/tum-nlp/bert-hateXplain on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

BERT for hate speech classification

The model is based on BERT and used for classifying a text as toxic and non-toxic. It achieved an F1 score of 0.81 and an Accuracy of 0.77.

The model was fine-tuned on the HateXplain dataset found here: https://huggingface.co/datasets/hatexplain

How to use

from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('tum-nlp/bert-hateXplain')
model = AutoModelForSequenceClassification.from_pretrained('tum-nlp/bert-hateXplain')

# Create the pipeline for classification
hate_classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)

# Predict
hate_classifier("I like you. I love you")
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train tum-nlp/bert-hateXplain

Collection including tum-nlp/bert-hateXplain