Downloads · 30 days
18
8% of all-time downloads
linhanhvlog123/xlmr-viquad2.0-qa
xlmr-viquad2.0-qa is a question answering model from linhanhvlog123. Use it when the input is a question plus a passage. It is set up for transformers.
This repository contains an XLM-RoBERTa model fine-tuned for extractive Question Answering (QA) on UIT-ViQuAD 2.0, a benchmark Vietnamese Machine Reading Comprehension (MRC) dataset with both answerable and unanswerab…
Downloads · 30 days
18
8% of all-time downloads
All-time downloads
232
Public
Parameters
277M
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
This repository contains an XLM-RoBERTa model fine-tuned for extractive Question Answering (QA) on UIT-ViQuAD 2.0, a benchmark Vietnamese Machine Reading Comprehension (MRC) dataset with both answerable and unanswerable questions, inspired by SQuAD 2.0.
The model is trained using the Hugging Face run_qa.py pipeline with a fixed hyperparameter configuration to enable fair comparison with other multilingual QA models (e.g. mBERT).
Task: Extractive Question Answering (Machine Reading Comprehension)
Language: Vietnamese
Input:
Output:
This setting follows the SQuAD 2.0 paradigm, where models must jointly:
UIT-ViQuAD 2.0 is a Vietnamese QA benchmark released for the VLSP 2021 MRC shared task, addressing a key limitation of earlier Vietnamese datasets by explicitly including unanswerable questions.
| Split | # Questions |
|---|---|
| Train | 28,457 |
| Dev | ~5,700 |
| Public Test | ~3,821 |
| Private Test | 3,712 |
{
"data": [
{
"title": "...",
"paragraphs": [
{
"context": "...",
"qas": [
{
"id": "uit_000001",
"question": "...",
"answers": [
{
"text": "...",
"answer_start": 123
}
],
"is_impossible": false
}
]
}
]
}
]
}
This format is required by the official evaluate-v2.0.py script for computing Exact Match (EM) and F1.
To train with run_qa.py, the dataset is flattened and normalized into the Hugging Face QA JSON format:
{
"id": "uit_000001",
"title": "...",
"context": "...",
"question": "...",
"answers": {
"text": ["..."],
"answer_start": [123]
}
}
The dataset is preprocessed in two stages:
Purpose:
Steps:
paragraphsanswers, is_impossiblePurpose:
run_qa.pySteps:
paragraphs → qas{text, answer_start}xlm-roberta-basestart_logits, end_logits)All models in this project share the same hyperparameters to ensure fair comparison.
Model: xlm-roberta-base
Max sequence length: 512
Document stride: 256
Train batch size: 16
Eval batch size: 8
Learning rate: 2e-5
Epochs: 3
Optimizer: AdamW
FP16: Enabled
Seed: 42
Version 2 QA: Enabled (unanswerable questions)
Training is performed using Hugging Face Trainer via run_qa.py.
Official evaluation is conducted using the SQuAD v2.0 evaluation script.
{
"exact": 47.25,
"f1": 56.84,
"HasAns_exact": 45.42,
"HasAns_f1": 59.12,
"NoAns_exact": 51.52,
"NoAns_f1": 51.52,
"total": 3712
}
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
model = AutoModelForQuestionAnswering.from_pretrained(
"linhanhvlog123/xlmr-viquad2.0-qa"
)
tokenizer = AutoTokenizer.from_pretrained(
"linhanhvlog123/xlmr-viquad2.0-qa"
)
from transformers import pipeline
qa = pipeline("question-answering", model=model, tokenizer=tokenizer)
qa({
"context": "...",
"question": "..."
})
This repository provides a baseline XLM-R model trained with fixed hyperparameters.
Further improvements may be obtained via:
If you use UIT-ViQuAD 2.0 or this model, please cite the original dataset paper from VLSP 2021.