Downloads · 30 days
8
8% of all-time downloads
linhanhvlog123/mbert-viquad2.0-qa
mbert-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 provides a multilingual BERT (mBERT) model fine-tuned for extractive Question Answering (QA) on UIT-ViQuAD 2.0, a Vietnamese Machine Reading Comprehension (MRC) benchmark that includes both answerable…
Downloads · 30 days
8
8% of all-time downloads
All-time downloads
103
Public
Parameters
177M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors709 MB · 99%
From the Hugging Face model README
This repository provides a multilingual BERT (mBERT) model fine-tuned for extractive Question Answering (QA) on UIT-ViQuAD 2.0, a Vietnamese Machine Reading Comprehension (MRC) benchmark that includes both answerable and unanswerable questions, following the SQuAD 2.0 setting.
The model is trained using the Hugging Face run_qa.py pipeline with a fixed hyperparameter configuration, enabling a fair and controlled comparison with other multilingual QA models such as XLM-RoBERTa.
Task: Extractive Question Answering (Machine Reading Comprehension)
Language: Vietnamese
Input:
Output:
This setup strictly follows the SQuAD 2.0 paradigm, where the model must:
UIT-ViQuAD 2.0 is a large-scale Vietnamese QA benchmark released for the VLSP 2021 Machine Reading Comprehension shared task, designed to address the lack of Vietnamese datasets containing 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 SQuAD v2.0 evaluation script (evaluate-v2.0.py) to compute Exact Match (EM) and F1-score.
To train with Hugging Face run_qa.py, the dataset is normalized into the following flat QA format:
{
"id": "uit_000001",
"title": "...",
"context": "...",
"question": "...",
"answers": {
"text": ["..."],
"answer_start": [123]
}
}
Unanswerable questions are represented with empty text and answer_start fields.
The dataset is preprocessed in two stages to ensure compatibility with both training and evaluation tools.
Purpose:
paragraphs, qas)Purpose:
run_qa.pyKey steps:
bert-base-multilingual-casedThe model is trained using a shared hyperparameter configuration, identical to other baseline models in this project.
Model: bert-base-multilingual-cased
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 the Hugging Face Trainer API via run_qa.py.
Evaluation is conducted using the official SQuAD v2.0 evaluation script on the private test set.
{
"exact": 49.33,
"f1": 60.36,
"HasAns_exact": 41.64,
"HasAns_f1": 57.41,
"NoAns_exact": 67.20,
"NoAns_f1": 67.20,
"total": 3712
}
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
model = AutoModelForQuestionAnswering.from_pretrained(
"linhanhvlog123/mbert-viquad2.0-qa"
)
tokenizer = AutoTokenizer.from_pretrained(
"linhanhvlog123/mbert-viquad2.0-qa"
)
from transformers import pipeline
qa = pipeline("question-answering", model=model, tokenizer=tokenizer)
qa({
"context": "...",
"question": "..."
})
This model serves as a baseline multilingual QA system for Vietnamese.
All hyperparameters are kept fixed to ensure fair comparison across models.
Further improvements may be achieved via:
If you use UIT-ViQuAD 2.0 or this model, please cite the original dataset paper from VLSP 2021.