tinyllama-hatexplain-lora

LoRA adapter (plus classification head) that turns TinyLlama/TinyLlama-1.1B-Chat-v1.0 into a 3-way hate speech classifier (hate, normal, offensive), trained on HateXplain.

Code, training script and evaluation: https://github.com/venkateshmedasani/SLM-based-hate-speech-recognition

Test-set results (2,015 held-out posts)

Metric Value
Accuracy 0.677
Macro F1 0.671
Weighted F1 0.679
Class Precision Recall F1
hate 0.760 0.768 0.764
normal 0.751 0.698 0.724
offensive 0.504 0.549 0.525

Usage

from peft import PeftModel
from transformers import AutoModelForSequenceClassification, AutoTokenizer

tok = AutoTokenizer.from_pretrained("venkateshmedasani/tinyllama-hatexplain-lora")
base = AutoModelForSequenceClassification.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", num_labels=3)
base.config.pad_token_id = tok.pad_token_id
model = PeftModel.from_pretrained(base, "venkateshmedasani/tinyllama-hatexplain-lora").merge_and_unload().eval()

Input text should be normalised with clean_text from src/text_utils.py in the GitHub repo (lower-case, punctuation stripped, @mentions to <user>), matching HateXplain's format.

Labels: 0 = hate, 1 = normal, 2 = offensive.

Limitations

Research artefact. Inherits the annotation biases of HateXplain, is English-only, and confuses hate with offensive more than any other pair of classes.

Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for venkateshmedasani/tinyllama-hatexplain-lora

Adapter
(1,610)
this model

Dataset used to train venkateshmedasani/tinyllama-hatexplain-lora