Views
No views yet
| Item | Description |
|---|---|
| Base model | xlm-roberta-base |
| Framework | PyTorch + 🤗 Transformers (v4.43.3) |
| Dataset size | 14,116 train / 1,765 val / 1,765 test |
| Sequence length | 256 |
| Task | Vietnamese NLI (Entailment / Contradiction / Neutral) |
| Language | Vietnamese 🇻🇳 |
| License | MIT (default HF sharing) |
| Author | @lyle49 |
full_data_true_conflict.json) includes Vietnamese NLI pairs with carefully normalized labels:| Split | Size | Label distribution |
|---|---|---|
| Train | 14,116 | c: 4,705 / n: 4,706 / e: 4,705 |
| Validation | 1,765 | c: 589 / n: 588 / e: 588 |
| Test | 1,765 | c: 588 / n: 588 / e: 589 |
1{
2 "id": "example_001",
3 "premise": "Anh ấy đang chơi bóng đá trên sân.",
4 "hypothesis": "Anh ấy đang tham gia một môn thể thao.",
5 "label": "e"
6}| Setting | Value |
|---|---|
| Epochs | 4 |
| Batch size | 8 × 2 (gradient accumulation = 2) |
| Optimizer | AdamW |
| Learning rate | 2e-5 |
| Warmup ratio | 0.06 |
| Weight decay | 0.01 |
| Precision | fp16 (AMP) |
| Gradient checkpointing | ✅ Enabled |
| Label smoothing | 0.05 |
| Early stopping | patience = 2 |
| Tokenizer max length | 256 |
| Save format | .safetensors |
| Split | Accuracy | F1 (macro) | Loss |
|---|---|---|---|
| Validation | 0.9807 | 0.9808 | 0.2278 |
| Test | 0.9796 | 0.9796 | 0.2354 |
| c | n | e | |
|---|---|---|---|
| c | 571 | 9 | 8 |
| n | 4 | 578 | 6 |
| e | 3 | 6 | 580 |
| Label | Precision | Recall | F1 |
|---|---|---|---|
| c | 0.9879 | 0.9711 | 0.9794 |
| n | 0.9747 | 0.9830 | 0.9788 |
| e | 0.9764 | 0.9847 | 0.9806 |
| Macro avg | 0.9797 | 0.9796 | 0.9796 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "lyle49/xlmr-vinli-finetune-full-6k"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8premise = "Anh ấy đang chơi bóng đá trên sân."
9hypothesis = "Anh ấy đang tham gia một môn thể thao."
10inputs = tokenizer(premise, hypothesis, return_tensors="pt", truncation=True, max_length=256)
11
12with torch.no_grad():
13 outputs = model(**inputs)
14 probs = torch.softmax(outputs.logits, dim=-1)
15 label = model.config.id2label[probs.argmax().item()]
16
17print(f"Prediction: {label} ({probs.max().item():.3f})")Prediction: e (0.980).safetensors for safety and compatibility.1@misc{lyle49_xlmr_vinli_2025,
2 author = {Lê, Lý},
3 title = {XLM-RoBERTa for Vietnamese NLI — Full 6K Finetune},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/lyle49/xlmr-vinli-finetune-full-6k}}
7}| File | Description |
|---|---|
config.json | Model configuration |
model.safetensors | Finetuned model weights |
tokenizer.json, tokenizer_config.json, special_tokens_map.json, sentencepiece.bpe.model | Tokenizer files |
README.md | This documentation |