加载中…
加载中…
A full fine-tune of distilbert-base-uncased that labels an English hotel review as negative or
positive. It is part of the krimits/hotel-review-nlp project. It was trained and
tested on splits of Booking.com reviews that share no review text.
It was scored on its test set of 13,263 reviews (3,263 negative). That set shares no review text with training. It was scored once, with the epoch that did best on dev.
| Measure | This model | TF-IDF + Naive Bayes, same test |
|---|---|---|
| Macro-F1 (95% bootstrap interval) | 0.9642 (0.9605–0.9677) | 0.9351 (0.9303–0.9398) |
| Accuracy | 97.33% | 95.14% |
| Negative reviews: recall / precision | 0.953 / 0.939 | 0.913 / 0.892 |
| Errors | 354 | 644 |
A second model, with the same architecture and training recipe, was trained on another split of the same reviews.
distilbert-base-uncased, seed 42, 2 epochs, batch
32, maximum length 256, learning rate 2e-05,
warm-up 6%, weight decay 0.01, fp16 training. The
checkpoint kept is the epoch with the best dev macro-F1.
994a103. Its metrics, logits and logs are
committed. The CI recomputes its scores from those logits. The
decision note compares it with Naive Bayes.model.safetensors SHA-256 f2a2bbc9a31c8f3b1d9bee46ec11bb3d8942e7e59c0ef4711c3cb2a6c1cf81c2.21d535c of the project
(scripts/publish_model.py).legacy-split-v1 (commit
9fe2f7f). It was trained on an earlier split whose test set shared 170 texts
with training.from transformers import AutoModelForSequenceClassification, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("krimits/distilbert-hotel-reviews")
model = AutoModelForSequenceClassification.from_pretrained("krimits/distilbert-hotel-reviews")
inputs = tokenizer("The room was spotless and the staff was wonderful.", return_tensors="pt")
print(model.config.id2label[model(**inputs).logits.argmax(-1).item()]) # positive