Instructions to use YoussefHarrabi/cat_v5c_s2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YoussefHarrabi/cat_v5c_s2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="YoussefHarrabi/cat_v5c_s2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("YoussefHarrabi/cat_v5c_s2") model = AutoModelForSequenceClassification.from_pretrained("YoussefHarrabi/cat_v5c_s2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
cat_v5c_s2
DeBERTa-v3-base fine-tuned specifically for Tunisian hotel reviews. It tags a review sentence with every category present, using seven independent sigmoid outputs.
Labels, in output order:
Room & Property, Food & Drink, Staff & Service, Location,
Pool & Beach, Spa & Wellness, Entertainment & Animation.
Location is kept for label order but is non-actionable: the dashboard excludes
it from aggregation, the UI and the score.
Training
Hand-labelled public reviews from Tunisian hotels. The checkpoint was scored on a held-out Tunisian property that was absent from training. The training corpus and the evaluation gold are not released.
Results
Held-out Tunisian property, six actionable categories, Location excluded:
| micro F1 | macro F1 |
|---|---|
| 0.903 | 0.905 |
Limitations
- English only.
- Hotel domain only; trained on Tunisian hotel reviews.
- Sentence-level: one sentence at a time, and a sentence can carry several categories.
- Maximum input length is 128 tokens; longer text is truncated.
Locationis predicted but non-actionable and excluded from the score.
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "YoussefHarrabi/cat_v5c_s2"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id).eval()
text = "The room was clean but the air conditioning was noisy."
with torch.no_grad():
logits = model(**tok(text, return_tensors="pt", truncation=True, max_length=128)).logits
probs = torch.sigmoid(logits)[0]
for label, p in zip(model.config.id2label.values(), probs):
print(f"{label}: {p:.3f}")
thresholds.json holds the per-label decision thresholds used by the dashboard.
from_pretrained does not apply them; compare each sigmoid with its own threshold.
Intended use
Sentence-level category tagging inside an aspect-based review dashboard. It is a multi-label classifier, not a sentiment model and not a whole-review scorer.
- Downloads last month
- 32