Downloads · 30 days
3
12% of all-time downloads
Strawberry0604/xlm-tourism-topic-classifier
xlm-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 XLM-RoBERTa model for multilingual tourism comment topic classification.
Downloads · 30 days
3
12% of all-time downloads
All-time downloads
25
Public
Repo size
3.3 GB
Likes
0
Public
Click a slice to open those files.
.pt3.3 GB · 100%
From the Hugging Face model README
Fine-tuned XLM-RoBERTa model for multilingual tourism comment topic classification.
This model classifies multilingual tourism comments into 7 topics:
| Metric | Score |
|---|---|
| F1 Macro | 53.74% |
| F1 Micro | 61.23% |
| Hamming Loss | 15.67% |
| Language | Comments |
|---|---|
| English (en) | 342 |
| Korean (ko) | 84 |
| Russian (ru) | 46 |
| German (de) | 37 |
| French (fr) | 24 |
| Others | 29 |
import torch
from transformers import AutoTokenizer
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base')
# Load model
model = torch.load('xlm_best_model.pt')
model.eval()
# Predict (works with any language)
text = "Beautiful scenery, great food, a bit expensive"
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.3).float() # Lower threshold for multilingual
# 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}")
This model is designed to work alongside PhoBERT:
@misc{xlm-tourism-classifier,
author = {Your Name},
title = {XLM-RoBERTa Tourism Topic Classifier},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/Strawberry0604/xlm-tourism-topic-classifier}}
}