Downloads · 30 days
6
3% of all-time downloads
metythorn/khmer-xlm-roberta-small
khmer-xlm-roberta-small is a fill-mask model from metythorn. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as apache-2.0.
This is a Pretrain Language Model using XLM-RoBERTa Architecture for Khmer & English language, trained for masked language modeling tasks.
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
228
Public
Parameters
93.7M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors375 MB · 100%
From the Hugging Face model README
This is a Pretrain Language Model using XLM-RoBERTa Architecture for Khmer & English language, trained for masked language modeling tasks.
from transformers import pipeline
# Load the model
fill_mask = pipeline("fill-mask", model="metythorn/khmer-xlm-roberta-small")
# Example usage
result = fill_mask("ខ្ញុំចង់<mask>ភាសាខ្មែរ")
print(result)
from transformers import AutoTokenizer, AutoModelForMaskedLM
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("metythorn/khmer-xlm-roberta-small")
model = AutoModelForMaskedLM.from_pretrained("metythorn/khmer-xlm-roberta-small")
# Example usage
text = "ខ្ញុំចង់<mask>ភាសាខ្មែរ"
inputs = tokenizer(text, return_tensors="pt")
# Get predictions for masked token
outputs = model(**inputs)
predictions = outputs.logits
print("Model loaded successfully!")
This model is designed for:
The model was trained on a custom Khmer dataset containing various text sources to ensure broad language coverage.
Use this model for masked language modeling evaluation:
from transformers import pipeline
import numpy as np
# Load model
fill_mask = pipeline("fill-mask", model="metythorn/khmer-xlm-roberta-small")
# Test examples
test_sentences = [
"ប្រទេសកម្ពុជាមាន<mask>ខេត្ត",
"រាជធានីភ្នំពេញគឺជ<mask>របស់ប្រទេសកម្ពុជា",
"ខ្ញុំចង់<mask>សៀវភៅ"
]
for sentence in test_sentences:
result = fill_mask(sentence)
print(f"Input: {sentence}")
print(f"Top prediction: {result[0]['token_str']}")
print("---")
If you use this model in your research, please cite:
@misc{xlm-roberta-khmer,
title={XLM-RoBERTa Khmer Masked Language Model},
author={Your Name},
year={2025},
url={https://huggingface.co/metythorn/khmer-xlm-roberta-small}
}