Views
No views yet
| Split | # Questions |
|---|---|
| Train | 28,457 |
| Dev | 3,821 |
| Private Test | 3,712 |
context: a Vietnamese paragraphquestion: a natural language questionanswers: answer spans (empty for unanswerable questions)evaluate-v2.0.py1{
2 "data": [
3 {
4 "paragraphs": [
5 {
6 "context": "...",
7 "qas": [
8 {
9 "id": "...",
10 "question": "...",
11 "answers": [
12 {
13 "text": "...",
14 "answer_start": 123
15 }
16 ],
17 "is_impossible": false
18 }
19 ]
20 }
21 ]
22 }
23 ]
24}run_qa.py.1{
2 "id": "...",
3 "context": "...",
4 "question": "...",
5 "answers": {
6 "text": ["..."],
7 "answer_start": [123]
8 }
9}🔁 This two-step preprocessing ensures fair evaluation and full compatibility with Hugging Face QA pipelines.
d_model): 768RobertaTokenizerFast1tokenizer = RobertaTokenizerFast.from_pretrained("vinai/phobert-base", use_fast=True)
2model.resize_token_embeddings(len(tokenizer))run_qa.py."max_position_embeddings": 258max_seq_length is 256The extra 2 positions are reserved for special tokens (e.g.<s>,</s>), following RoBERTa-style encoding.
1python run_qa.py \
2 --model_name_or_path vinai/phobert-base \
3 --train_file train_hf.json \
4 --validation_file dev_hf.json \
5 --do_train \
6 --do_eval \
7 --version_2_with_negative \
8 --learning_rate 2e-5 \
9 --num_train_epochs 3 \
10 --per_device_train_batch_size 16 \
11 --per_device_eval_batch_size 8 \
12 --max_seq_length 256 \
13 --doc_stride 128 \
14 --seed 42 \
15 --fp16 \
16 --output_dir phobert_viquadℹ️ A fixed hyperparameter setting is used across models (PhoBERT, mBERT, XLM-R) to ensure fair comparison. Model-specific optimization is left for future experiments.
evaluate-v2.0.py (SQuAD v2.0 script):1{
2 "exact": 45.64,
3 "f1": 55.83,
4 "HasAns_exact": 42.41,
5 "HasAns_f1": 56.99,
6 "NoAns_exact": 53.14,
7 "NoAns_f1": 53.14,
8 "total": 3712
9}| Model | Max Seq Length | EM | F1 |
|---|---|---|---|
| mBERT | 512 | 49.33 | 60.36 |
| XLM-R | 512 | 47.25 | 56.84 |
| PhoBERT | 256 | 45.64 | 55.83 |