emotion-classifier-bg-en

Emotion classifier for English translations of Bulgarian reality-TV lines, made in a BUas ADSAI student project (Year 2 Block A, group 1) for the Content Intelligence Agency (CIA). FacebookAI/roberta-large, fully fine-tuned.

  • Input: one line plus up to 5 earlier lines of the episode, as Earlier lines:\n<earlier lines>\nLine: <line> (just Line: <line> for the first line), at most 256 tokens. Long inputs lose their oldest context first (the tokenizer truncates on the left).
  • Output: one of seven emotions: anger, disgust, fear, happiness, neutral, sadness, surprise.
  • Scores: macro-F1 0.572 on CIA validation lines (4,541), 0.504 on our Bulgarian test episode (917 lines).
  • Trained on: 19,308 lines from other groups' TV episodes, labelled by CIA's LLM pipeline.

Full model card (data, evaluation, limitations, ethics): task11/model_card.md

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

repo = "Shadowiee/emotion-classifier-bg-en"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo, dtype=torch.float32).eval()

text = "Earlier lines:\nYou have been nominated.\nLine: What? No way!"
with torch.no_grad():
    logits = model(**tokenizer(text, return_tensors="pt", truncation=True, max_length=256)).logits
probs = torch.softmax(logits, -1)[0]
print(model.config.id2label[int(probs.argmax())], round(float(probs.max()), 3))

Pass dtype=torch.float32: Transformers 5 otherwise keeps the dtype a checkpoint was saved in.

Downloads last month
42
Safetensors
Model size
0.4B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Shadowiee/emotion-classifier-bg-en

Finetuned
(449)
this model