Views
No views yet
roberta-base, fine-tuned with class-weighted loss to address label imbalance.| Metric | Value |
|---|---|
| Accuracy | 0.81 |
| Macro F1 | 0.81 |
| Weighted F1 | 0.81 |
Metrics computed on the same held-out test split (data/processed/splits/)
usingreports/category_metrics_v1.json
{ "0": "E", "1": "S", "2": "G" }from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "salitahir/roberta-esg-category-green-guard-v1"
tok = AutoTokenizer.from_pretrained(model_id)
mod = AutoModelForSequenceClassification.from_pretrained(model_id).eval()
text = "We invested in renewable energy sources for our operations."
inputs = tok(text, return_tensors="pt", truncation=True)
pred = torch.softmax(mod(**inputs).logits, dim=-1)
label_id = pred.argmax(-1).item()
label = mod.config.id2label[str(label_id)]
print(label, float(pred[0][label_id]))