google-research-datasets/go_emotions
Viewer • Updated • 265k • 14.8k • 264
How to use davanstrien/lfm25-encoder-goemotions-smoke with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="davanstrien/lfm25-encoder-goemotions-smoke", trust_remote_code=True) # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("davanstrien/lfm25-encoder-goemotions-smoke", trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained("davanstrien/lfm25-encoder-goemotions-smoke", trust_remote_code=True, device_map="auto")LiquidAI/LFM2.5-Encoder-350M fine-tuned for multi-label text classification on google-research-datasets/go_emotions.
admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, surprise, neutralThis model uses a custom classification head (mean pooling over a backbone without a native sequence-classification class), so loading requires
trust_remote_code=True. vLLM serving requires a standard architecture.
| Metric | Value |
|---|---|
| f1_micro @ 0.5 | 0.0000 |
| f1_macro @ 0.5 | 0.0000 |
| f1_micro @ tuned | 0.2436 |
| f1_macro @ tuned | 0.0786 |
Per-label decision thresholds tuned on the eval split are stored in
config.classifier_thresholds.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("davanstrien/lfm25-encoder-goemotions-smoke", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("davanstrien/lfm25-encoder-goemotions-smoke", trust_remote_code=True)
inputs = tokenizer("your text here", return_tensors="pt", truncation=True)
probs = torch.sigmoid(model(**inputs).logits)[0]
thresholds = torch.tensor(model.config.classifier_thresholds) # tuned on validation
labels = [model.config.id2label[i] for i in (probs >= thresholds).nonzero().flatten().tolist()]
print(labels)
Produced on Hugging Face Jobs (gpu) with the train-classifier.py recipe from uv-scripts. Run it yourself:
hf jobs uv run --flavor gpu --secrets HF_TOKEN \
https://huggingface.co/datasets/uv-scripts/classification/raw/main/train-classifier.py \
google-research-datasets/go_emotions davanstrien/lfm25-encoder-goemotions-smoke --label-column labels
Base model
LiquidAI/LFM2.5-350M-Base