|
|
--- |
|
|
license: mit |
|
|
language: |
|
|
- vi |
|
|
tags: |
|
|
- ag |
|
|
- t5 |
|
|
- vit5 |
|
|
- squad-format |
|
|
- vietnamese |
|
|
- education |
|
|
- nlp |
|
|
pretty_name: vietnamese Question Generation |
|
|
size_categories: |
|
|
- 10K<n<100K |
|
|
--- |
|
|
|
|
|
# HVU_QA |
|
|
|
|
|
**HVU_QA** is an open-source Vietnamese Question–Context–Answer (QCA) corpus for building FAQ-style question generation systems in low-resource languages. |
|
|
It was created using a fully automated pipeline combining web crawling, semantic tag-based extraction, and AI-assisted filtering to ensure high factual accuracy. |
|
|
|
|
|
## Dataset Description |
|
|
|
|
|
- Language: Vietnamese |
|
|
- Format: SQuAD-style JSON |
|
|
- Size: 30,000 QCA triples |
|
|
- Domains: Social services, labor law, administrative processes, and public service topics |
|
|
|
|
|
Each data sample contains: |
|
|
- `question`: The generated or extracted question |
|
|
- `context`: The supporting passage |
|
|
- `answer`: The answer span within the context |
|
|
|
|
|
## Dataset Creation |
|
|
|
|
|
**Pipeline:** |
|
|
1. Selecting relevant QA websites from trusted sources |
|
|
2. Automated crawling to collect raw QA webpages |
|
|
3. Semantic tag-based extraction to get clean QCA triples |
|
|
4. AI-assisted filtering to remove noisy or inconsistent samples |
|
|
|
|
|
**Annotation & Licensing:** |
|
|
All data are collected from public-domain Vietnamese government and service portals, released under CC BY 4.0. |
|
|
|
|
|
## Quality Evaluation |
|
|
|
|
|
A fine-tuned `VietAI/vit5-base` model trained on **HVU_QA** was used to validate the dataset quality. |
|
|
|
|
|
**Automatic metrics:** |
|
|
|
|
|
| Metric | Score | |
|
|
|-----------------------|----------------------| |
|
|
| BLEU | 90.61 | |
|
|
| Semantic similarity | 97.0% (cosine ≥ 0.8) | |
|
|
|
|
|
**Human evaluation (1–5 scale):** |
|
|
|
|
|
| Aspect | Avg. Score | |
|
|
|------------------|-------------| |
|
|
| Grammaticality | 4.58 / 5 | |
|
|
| Usefulness | 4.29 / 5 | |
|
|
|
|
|
These results confirm that **HVU_QA** is a high-quality resource for developing robust FAQ-style question generation models. |
|
|
|
|
|
## Setup |
|
|
|
|
|
### Step 1 — Clone repository (optional if local) |
|
|
|
|
|
```bash |
|
|
git clone https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions |
|
|
cd GeneratingQuestions |
|
|
``` |
|
|
|
|
|
### Step 2 — Install dependencies |
|
|
|
|
|
**Minimal:** |
|
|
```bash |
|
|
python -m pip install --upgrade pip |
|
|
pip install datasets transformers sentencepiece safetensors |
|
|
``` |
|
|
|
|
|
**Recommended (for training & evaluation):** |
|
|
```bash |
|
|
pip install datasets transformers sentencepiece safetensors accelerate evaluate sacrebleu rouge-score nltk tensorboard scikit-learn |
|
|
``` |
|
|
|
|
|
**Install PyTorch (choose CUDA/CPU from https://pytorch.org):** |
|
|
```bash |
|
|
pip install torch |
|
|
``` |
|
|
|
|
|
### Step 3 — (Optional) Configure environment |
|
|
|
|
|
```bash |
|
|
pip install -U huggingface_hub |
|
|
huggingface-cli login |
|
|
git lfs install |
|
|
``` |
|
|
|
|
|
Only needed if you want to push to Hub or download private models. |
|
|
|
|
|
### Step 4 — Download data |
|
|
|
|
|
```python |
|
|
from datasets import load_dataset |
|
|
ds = load_dataset("DANGDOCAO/GeneratingQuestions", split="train") |
|
|
print(ds[0]) |
|
|
``` |
|
|
|
|
|
Or from local JSON: |
|
|
```python |
|
|
ds = load_dataset("json", data_files="30ktrain.json", split="train") |
|
|
``` |
|
|
|
|
|
### Step 5 — Verify installation |
|
|
|
|
|
```bash |
|
|
python -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors; print('All installed OK!')" |
|
|
``` |
|
|
|
|
|
## Usage |
|
|
|
|
|
### Fine-tune model |
|
|
|
|
|
```bash |
|
|
python fine_tune_qg.py |
|
|
``` |
|
|
|
|
|
This will: |
|
|
1. Load data from `30ktrain.json` |
|
|
2. Fine-tune `VietAI/vit5-base` |
|
|
3. Save model to `t5-viet-qg-finetuned/` |
|
|
|
|
|
### Generate questions |
|
|
|
|
|
```bash |
|
|
python generate_question.py |
|
|
``` |
|
|
|
|
|
Example |
|
|
``` |
|
|
Input passage: |
|
|
Iced milk coffee (Cà phê sữa đá) is a famous drink in Vietnam. |
|
|
Number of questions: 5 |
|
|
``` |
|
|
|
|
|
Output |
|
|
1. What type of coffee is famous in Vietnam? |
|
|
2. Why is iced milk coffee popular? |
|
|
3. What ingredients are included in iced milk coffee? |
|
|
4. Where does iced milk coffee originate from? |
|
|
5. How is Vietnamese iced milk coffee prepared? |
|
|
|
|
|
Adjustable parameters (`generate_question.py`): |
|
|
`top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty` |
|
|
|
|
|
## Citation |
|
|
|
|
|
```bibtex |
|
|
@inproceedings{nguyen2025hvuqa, |
|
|
title={A Method to Build QA Corpora for Low-Resource Languages}, |
|
|
author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van}, |
|
|
booktitle={Proceedings of the International Conference on Knowledge and Systems Engineering (KSE)}, |
|
|
year={2025} |
|
|
} |
|
|
``` |