Views
No views yet
| Metric | Value |
|---|---|
| Accuracy | 94% |
| F1 (macro) | 94% |
| AUC | 0.9933 |
| Error rate | 0.056 |
| Category | Precision | Recall | F1 |
|---|---|---|---|
| economic | 0.91 | 0.94 | 0.93 |
| entertainment | 0.94 | 0.97 | 0.96 |
| life | 0.87 | 0.82 | 0.85 |
| politic | 0.97 | 0.96 | 0.97 |
| sport | 0.97 | 0.99 | 0.98 |
| technology | 0.93 | 0.92 | 0.92 |
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="kidkidmoon/xlm-r-khmer-news-classification"
6)
7
8text = "នាយករដ្ឋមន្ត្រីបានថ្លែងនៅក្នុងសន្និសីទសារព័ត៌មាន" # Khmer text
9result = classifier(text)
10print(result)1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "kidkidmoon/xlm-r-khmer-news-classification"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8inputs = tokenizer("your Khmer text here", return_tensors="pt", truncation=True)
9with torch.no_grad():
10 logits = model(**inputs).logits
11
12predicted_class = logits.argmax().item()
13print(model.config.id2label[predicted_class])1@misc{kimlangsrun2025khmer,
2 author = {Srun Kimlang},
3 title = {XLM-RoBERTa Fine-tuned for Khmer News Classification},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/kidkidmoon/xlm-r-khmer-news-classification}
7}