Views
No views yet
| Metric | Before Calibration | After Calibration | Improvement |
|---|---|---|---|
| Accuracy | 52.6% | 64.0% | +11.4% |
| MAE | 0.126 | 0.104 | -0.022 |
| RMSE | 0.168 | 0.141 | -0.027 |
| Score | Category |
|---|---|
| 0.00 - 0.20 | Very Negative |
| 0.21 - 0.40 | Negative |
| 0.41 - 0.60 | Neutral |
| 0.61 - 0.80 | Positive |
| 0.81 - 1.00 | Very Positive |
1from transformers import AutoTokenizer
2from modeling_calibrated import CalibratedRegressionModel
3
4# Load model (calibration is automatic!)
5model_name = "your-username/roberta-singapore-sentiment"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = CalibratedRegressionModel.from_pretrained(model_name)
8
9# Predict sentiment
10text = "This chicken rice is damn shiok sia!"
11result = model.predict_sentiment(text, tokenizer)
12
13print(f"Score: {result['score']:.3f}") # 0.875
14print(f"Category: {result['category']}") # "Very Positive"cardiffnlp/twitter-roberta-base-sentiment-latest1@misc{roberta-singapore-calibrated,
2 title = {Singapore Sentiment Analyzer - ROBERTA (Calibrated)},
3 year = {2026},
4 publisher = {HuggingFace},
5 url = {https://huggingface.co/your-username/roberta-singapore-sentiment}
6}