H-Z-Ning/Senti-RoBERTa-Mini is a lightweight Chinese RoBERTa model fine-tuned specifically for assigning 1-to-5-star sentiment ratings to Chinese movie short reviews. Built on the HFL-Tencent hfl/chinese-roberta-wwm-ext checkpoint, it retains a small footprint and fast inference, making it ideal for resource-constrained deployments.| Item | Details |
|---|---|
| Task | Chinese text classification (sentiment / star rating) |
| Labels | 5 classes (1 star – 5 stars) |
| Base model | hfl/chinese-roberta-wwm-ext |
| Dataset | Kaggle: Douban Movie Short Comments (2000 K) |
| Training framework | 🤗 transformers + Trainer |
| Language | Simplified Chinese |
| Parameters | ≈ 102 M (same as base model) |
pip install transformers torch1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4repo = "H-Z-Ning/Senti-RoBERTa-Mini"
5tok = AutoTokenizer.from_pretrained(repo)
6model = AutoModelForSequenceClassification.from_pretrained(repo)
7
8text = "这个导演真厉害。"
9inputs = tok(text, return_tensors="pt", truncation=True, max_length=256)
10with torch.no_grad():
11 logits = model(**inputs).logits
12pred = int(torch.argmax(logits, dim=-1).item()) + 1 # 1..5
13print("predicted rating:", pred)| Hyper-parameter | Value |
|---|---|
| Base model | hfl/chinese-roberta-wwm-ext |
| Training framework | 🤗 transformers Trainer |
| Training set | 150 000 samples (randomly drawn from 2000 K) |
| Validation set | 15 000 samples (same random draw) |
| Test set | full original test set |
| Max sequence length | 256 |
| Training epochs | 3 |
| Batch size | 32 (train) / 64 (eval) |
| Learning rate | 2e-5 |
| Optimizer | AdamW |
| Weight decay | 0.01 |
| Scheduler | linear warmup (warmup_ratio=0.1) |
| Precision | FP16 |
| Best-model criterion | QWK (↑) |
| Training time | ≈ 120 min on single P100 (FP16) |
| Logging interval | every 10 steps |
1@misc{senti-roberta-mini-2025,
2 title={Senti-RoBERTa-Mini: A Mini Chinese RoBERTa for Movie Review Rating},
3 author={H-Z-Ning},
4 year={2025},
5 howpublished={\url{https://huggingface.co/H-Z-Ning/Senti-RoBERTa-Mini}}
6}hfl/chinese-roberta-wwm-ext is also Apache-2.0.