Datasets:
update README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HVU_QA
|
| 2 |
+
|
| 3 |
+
**HVU_QA** is an open-source Vietnamese Question–Context–Answer (QCA) corpus and supporting tools for building FAQ-style question generation systems in low-resource languages.
|
| 4 |
+
The dataset was created using a fully automated pipeline that combines web crawling from trustworthy sources, semantic tag-based extraction, and AI-assisted filtering to ensure high factual accuracy.
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## 📋 Dataset Description
|
| 9 |
+
|
| 10 |
+
- **Language:** Vietnamese
|
| 11 |
+
- **Format:** SQuAD-style JSON
|
| 12 |
+
- **Total samples:** 30,000 QCA triples
|
| 13 |
+
- **Domains covered:** Social services, labor law, administrative processes, and other public service topics.
|
| 14 |
+
|
| 15 |
+
Each data sample contains:
|
| 16 |
+
- `question`: Generated or extracted question
|
| 17 |
+
- `context`: Supporting text passage from which the answer is derived
|
| 18 |
+
- `answer`: Answer span within the context
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## ⚙️ Dataset Creation
|
| 23 |
+
|
| 24 |
+
**Pipeline:**
|
| 25 |
+
1. Selecting relevant QA websites from trusted sources
|
| 26 |
+
2. Automated data crawling to collect raw QA webpages
|
| 27 |
+
3. Extraction via semantic tags to obtain clean Question–Context–Answer triples
|
| 28 |
+
4. AI-assisted filtering to remove noisy or factually inconsistent samples
|
| 29 |
+
|
| 30 |
+
**Licensing:** All data are collected from public-domain Vietnamese government/service portals and released under CC BY 4.0.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## 📊 Quality Evaluation
|
| 35 |
+
|
| 36 |
+
A fine-tuned `VietAI/vit5-base` model trained on HVU_QA achieved:
|
| 37 |
+
|
| 38 |
+
| Metric | Score |
|
| 39 |
+
|----------------------|--------------|
|
| 40 |
+
| BLEU | 90.61 |
|
| 41 |
+
| Semantic similarity | 97.0% (cos ≥ 0.8) |
|
| 42 |
+
| Human grammar score | 4.58 / 5 |
|
| 43 |
+
| Human usefulness | 4.29 / 5 |
|
| 44 |
+
|
| 45 |
+
These results confirm that HVU_QA is a high-quality resource for developing robust FAQ-style question generation models.
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## ⚡ How to Use
|
| 50 |
+
|
| 51 |
+
### 📦 Install Dependencies
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
pip install datasets transformers sentencepiece safetensors accelerate evaluate sacrebleu rouge-score nltk scikit-learn
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
*(Install PyTorch separately from [pytorch.org](https://pytorch.org) if not installed yet)*
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
### 📥 Load Dataset from Hugging Face Hub
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
from datasets import load_dataset
|
| 65 |
+
ds = load_dataset("DANGDOCAO/GeneratingQuestions", split="train")
|
| 66 |
+
print(ds[0])
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## 🚀 Example Usage
|
| 72 |
+
|
| 73 |
+
### Fine-tuning
|
| 74 |
+
|
| 75 |
+
```bash
|
| 76 |
+
python fine_tune_qg.py
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
This will:
|
| 80 |
+
1. Load the dataset from `30ktrain.json`
|
| 81 |
+
2. Fine-tune `VietAI/vit5-base`
|
| 82 |
+
3. Save the trained model into `t5-viet-qg-finetuned/`
|
| 83 |
+
|
| 84 |
+
*(Or download the pre-trained model: [t5-viet-qg-finetuned](https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions/tree/main))*
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
### Generating Questions
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
python generate_question.py
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
**Example:**
|
| 95 |
+
```
|
| 96 |
+
Input passage:
|
| 97 |
+
Iced milk coffee is a famous drink in Vietnam.
|
| 98 |
+
Number of questions: 5
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
**Output:**
|
| 102 |
+
1. What type of coffee is famous in Vietnam?
|
| 103 |
+
2. Why is iced milk coffee popular?
|
| 104 |
+
3. What ingredients are included in iced milk coffee?
|
| 105 |
+
4. Where does iced milk coffee originate from?
|
| 106 |
+
5. How is Vietnamese iced milk coffee prepared?
|
| 107 |
+
|
| 108 |
+
**You can adjust** in `generate_question.py`:
|
| 109 |
+
`top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty`
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## 📌 Citation
|
| 114 |
+
|
| 115 |
+
If you use **HVU_QA** in your research, please cite:
|
| 116 |
+
|
| 117 |
+
```bibtex
|
| 118 |
+
@inproceedings{nguyen2025hvuqa,
|
| 119 |
+
title={A Method to Build QA Corpora for Low-Resource Languages},
|
| 120 |
+
author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van},
|
| 121 |
+
booktitle={Proceedings of the International Conference on Knowledge and Systems Engineering (KSE)},
|
| 122 |
+
year={2025}
|
| 123 |
+
}
|
| 124 |
+
```
|