Downloads · 30 days
15
25% of all-time downloads
Strawberry0604/phobert-tourism-topic-classifier
phobert-tourism-topic-classifier is a text classification model from Strawberry0604. Use it when you need a label for a piece of text. The card lists the license as mit.
Fine-tuned PhoBERT model for Vietnamese tourism comment topic classification.
Downloads · 30 days
15
25% of all-time downloads
All-time downloads
60
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.pt1.6 GB · 100%
From the Hugging Face model README
Fine-tuned PhoBERT model for Vietnamese tourism comment topic classification.
This model classifies Vietnamese tourism comments into 7 topics:
| Metric | Score |
|---|---|
| F1 Macro | 56.38% |
| F1 Micro | 68.23% |
| Hamming Loss | 12.34% |
| Topic | F1 Score |
|---|---|
| scenery | 72.34% |
| food | 68.91% |
| service | 56.23% |
| pricing | 50.12% |
| facilities | 48.23% |
| activities | 45.12% |
| accessibility | 38.67% |
import torch
from transformers import AutoTokenizer
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained('vinai/phobert-base')
# Load model
model = torch.load('phobert_best_model.pt')
model.eval()
# Predict
text = "Cảnh đẹp quá, đồ ăn ngon"
encoding = tokenizer(text, return_tensors='pt', max_length=256,
padding='max_length', truncation=True)
with torch.no_grad():
logits = model(encoding['input_ids'], encoding['attention_mask'])
probs = torch.sigmoid(logits)
predictions = (probs > 0.5).float()
# Get topics
topics = ['scenery', 'food', 'service', 'pricing', 'facilities', 'activities', 'accessibility']
predicted_topics = [topics[i] for i, pred in enumerate(predictions[0]) if pred == 1]
print(f"Predicted topics: {predicted_topics}")
@misc{phobert-tourism-classifier,
author = {Your Name},
title = {PhoBERT Tourism Topic Classifier},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/Strawberry0604/phobert-tourism-topic-classifier}}
}