Views
No views yet
xlm-roberta-base model, specifically adapted for Natural Language Inference (NLI) tasks in Vietnamese. It classifies the relationship between a given premise and hypothesis into one of three categories: entailment, neutral, or contradiction./kaggle/input/train-nli/train.json/kaggle/input/train-nli/vinli_dev.json/kaggle/input/train-nli/vinli_test.json| Label | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| contradiction | 0.7061 | 0.6716 | 0.6885 | 737 |
| neutral | 0.7240 | 0.7799 | 0.7509 | 777 |
| entailment | 0.7631 | 0.7387 | 0.7507 | 750 |
| Accuracy | 0.7310 | 2264 | ||
| Macro avg | 0.7311 | 0.7301 | 0.7300 | 2264 |
| Predicted C | Predicted N | Predicted E | |
|---|---|---|---|
| Gold C | 495 | 132 | 110 |
| Gold N | 109 | 606 | 62 |
| Gold E | 97 | 99 | 554 |
transformers library.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "lyle49/xlmr-vinli-finetune"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8premise = "Một sào lúa non nuôi con nửa ngày"
9hypothesis = "Lúa non chỉ nuôi được nửa ngày"
10inputs = tokenizer(premise, hypothesis, return_tensors="pt", truncation=True, max_length=256)
11
12with torch.no_grad():
13 logits = model(**inputs).logits
14 pred_id = logits.argmax(dim=-1).item()
15
16id2label = model.config.id2label
17print("Prediction:", id2label[pred_id])xlm-roberta-large for potentially better performance, though this may require a smaller batch size to accommodate the larger model.1@misc{xlmr_vinli_finetune,
2 author = {Lê Lý},
3 title = {XLM-RoBERTa fine-tuned on Vietnamese NLI},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/lyle49/xlmr-vinli-finetune}}
7}