Datasets:
Delete README.md
Browse files
README.md
DELETED
|
@@ -1,298 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
language:
|
| 4 |
-
- vi
|
| 5 |
-
tags:
|
| 6 |
-
- question-generation
|
| 7 |
-
- qg, t5, vit5, squad-format, vietnamese, education, nlp
|
| 8 |
-
pretty_name: Vietnamese Question Generation
|
| 9 |
-
size_categories:
|
| 10 |
-
- 10K<n<100K
|
| 11 |
-
task_categories:
|
| 12 |
-
- text-generation
|
| 13 |
-
---
|
| 14 |
-
# HVU_QA
|
| 15 |
-
|
| 16 |
-
**HVU_QA** is a project dedicated to sharing datasets and tools for **Question Generation Processing (NLP)**, developed and maintained by the research team at **Hung Vuong University (HVU), Phu Tho, Vietnam**.
|
| 17 |
-
This project is supported by **Hung Vuong University, Phu Tho, Vietnam**, with the aim of advancing research and applications in low-resource language processing, particularly for the Vietnamese language.
|
| 18 |
-
|
| 19 |
-
---
|
| 20 |
-
|
| 21 |
-
## 📚 Overview
|
| 22 |
-
|
| 23 |
-
This repository enables you to:
|
| 24 |
-
|
| 25 |
-
1. Fine-tune the [VietAI/vit5-base](https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions) model on your own GQ dataset.
|
| 26 |
-
2. Generate multiple, diverse questions given a user-provided text passage (context).
|
| 27 |
-
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
## 📁 Datasets
|
| 31 |
-
|
| 32 |
-
* Built following the **SQuAD v2.0 standard**, ensuring compatibility with NLP pipelines.
|
| 33 |
-
* Includes tens of thousands of high-quality **Question–Context–Answer triples (QCA)**.
|
| 34 |
-
* Suitable for both **training** and **evaluation**.
|
| 35 |
-
|
| 36 |
-
---
|
| 37 |
-
|
| 38 |
-
## 📁 Vietnamese Question Generation Tool
|
| 39 |
-
|
| 40 |
-
A **command-line tool** for:
|
| 41 |
-
|
| 42 |
-
* **Fine-tuning** a question generation model.
|
| 43 |
-
* **Automatically generating questions** from Vietnamese text.
|
| 44 |
-
|
| 45 |
-
Built on **Hugging Face Transformers (VietAI/vit5-base)** and **PyTorch**.
|
| 46 |
-
|
| 47 |
-
---
|
| 48 |
-
|
| 49 |
-
## Features
|
| 50 |
-
|
| 51 |
-
* Fine-tune a question generation model with SQuAD v2.0 format data.
|
| 52 |
-
* Generate diverse and creative questions from text passages.
|
| 53 |
-
* Flexible generation parameters (`top-k`, `top-p`, `temperature`, etc.).
|
| 54 |
-
* Simple command-line usage.
|
| 55 |
-
* GPU support if available.
|
| 56 |
-
|
| 57 |
-
---
|
| 58 |
-
|
| 59 |
-
## 📊 Evaluation Results
|
| 60 |
-
|
| 61 |
-
We conducted both **manual evaluation** (500 samples) and **automatic evaluation** (1,000 samples).
|
| 62 |
-
|
| 63 |
-
| Evaluation Type | Precision | Recall | F1-Score |
|
| 64 |
-
|------------------|-----------|--------|----------|
|
| 65 |
-
| Automatic (1000) | 0.85 | 0.83 | 0.84 |
|
| 66 |
-
| Manual (500) | 0.88 | 0.86 | 0.87 |
|
| 67 |
-
|
| 68 |
-
➡️ The model generates diverse, grammatically correct, and contextually appropriate questions.
|
| 69 |
-
|
| 70 |
-
---
|
| 71 |
-
|
| 72 |
-
## Creation Process
|
| 73 |
-
|
| 74 |
-
The dataset was built using a **4-stage automated pipeline**:
|
| 75 |
-
|
| 76 |
-
1. Select relevant QA websites from trusted sources.
|
| 77 |
-
2. Automatic crawling to collect raw QA pages.
|
| 78 |
-
3. Semantic tag extraction to obtain clean Question–Context–Answer triples.
|
| 79 |
-
4. AI-assisted filtering to remove noisy or inconsistent samples.
|
| 80 |
-
|
| 81 |
-
---
|
| 82 |
-
|
| 83 |
-
## 📝 Quality Evaluation
|
| 84 |
-
|
| 85 |
-
A fine-tuned model trained on **HVU_QA (VietAI/vit5-base)** achieved:
|
| 86 |
-
|
| 87 |
-
* **BLEU Score**: 90.61
|
| 88 |
-
* **Semantic similarity**: 97.0% (cosine ≥ 0.8)
|
| 89 |
-
* **Human evaluation**:
|
| 90 |
-
* Grammar: **4.58 / 5**
|
| 91 |
-
* Usefulness: **4.29 / 5**
|
| 92 |
-
|
| 93 |
-
➡️ These results confirm that **HVU_QA is a high-quality resource** for developing robust FAQ-style question generation models.
|
| 94 |
-
|
| 95 |
-
---
|
| 96 |
-
|
| 97 |
-
## 📂 Project Structure
|
| 98 |
-
|
| 99 |
-
```
|
| 100 |
-
.HVU_QA
|
| 101 |
-
├── t5-viet-qg-finetuned/
|
| 102 |
-
├── fine_tune_qg.py
|
| 103 |
-
├── generate_question.py
|
| 104 |
-
├── 30ktrain.json
|
| 105 |
-
└── README.md
|
| 106 |
-
```
|
| 107 |
-
> All data files are UTF-8 encoded and ready for use in NLP pipelines.
|
| 108 |
-
|
| 109 |
-
---
|
| 110 |
-
|
| 111 |
-
## 🛠️ Requirements
|
| 112 |
-
|
| 113 |
-
* Python 3.8+
|
| 114 |
-
* PyTorch >= 1.9
|
| 115 |
-
* Transformers >= 4.30
|
| 116 |
-
* scikit-learn
|
| 117 |
-
* Fine-tuned model (download at: [link](https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions/tree/main))
|
| 118 |
-
|
| 119 |
-
---
|
| 120 |
-
|
| 121 |
-
## ⚙️ Setup
|
| 122 |
-
|
| 123 |
-
### 🛠️ Step 1: Download and Extract
|
| 124 |
-
|
| 125 |
-
1. Download `HVU_QA.zip`
|
| 126 |
-
2. Extract into a folder, e.g.:
|
| 127 |
-
|
| 128 |
-
```
|
| 129 |
-
D:\your\HVU_QA
|
| 130 |
-
```
|
| 131 |
-
|
| 132 |
-
### 🛠️ Step 2: Add to Environment Path (if needed)
|
| 133 |
-
|
| 134 |
-
1. Open **System Properties → Environment Variables**
|
| 135 |
-
2. Select `Path` → **Edit** → **New**
|
| 136 |
-
3. Add the path, e.g.:
|
| 137 |
-
|
| 138 |
-
```
|
| 139 |
-
D:\your\HVU_QA
|
| 140 |
-
```
|
| 141 |
-
|
| 142 |
-
### 🛠️ Step 3: Open in Visual Studio Code
|
| 143 |
-
|
| 144 |
-
```
|
| 145 |
-
File > Open Folder > D:\HVU_QA
|
| 146 |
-
```
|
| 147 |
-
|
| 148 |
-
### 🛠️ Step 4: Install Required Libraries
|
| 149 |
-
|
| 150 |
-
Open **Terminal** and run:
|
| 151 |
-
|
| 152 |
-
#### Windows (PowerShell)
|
| 153 |
-
|
| 154 |
-
**Required only**
|
| 155 |
-
|
| 156 |
-
```powershell
|
| 157 |
-
python -m pip install --upgrade pip
|
| 158 |
-
pip install torch transformers datasets scikit-learn sentencepiece safetensors
|
| 159 |
-
```
|
| 160 |
-
|
| 161 |
-
**Required + Optional**
|
| 162 |
-
|
| 163 |
-
```powershell
|
| 164 |
-
python -m pip install --upgrade pip
|
| 165 |
-
pip install torch transformers datasets scikit-learn sentencepiece safetensors accelerate tensorboard evaluate sacrebleu rouge-score nltk
|
| 166 |
-
```
|
| 167 |
-
|
| 168 |
-
#### Linux / macOS (bash/zsh)
|
| 169 |
-
|
| 170 |
-
**Required only**
|
| 171 |
-
|
| 172 |
-
```bash
|
| 173 |
-
python3 -m pip install --upgrade pip
|
| 174 |
-
pip install torch transformers datasets scikit-learn sentencepiece safetensors
|
| 175 |
-
```
|
| 176 |
-
|
| 177 |
-
**Required + Optional**
|
| 178 |
-
|
| 179 |
-
```bash
|
| 180 |
-
python3 -m pip install --upgrade pip
|
| 181 |
-
pip install torch transformers datasets scikit-learn sentencepiece safetensors accelerate tensorboard evaluate sacrebleu rouge-score nltk
|
| 182 |
-
```
|
| 183 |
-
|
| 184 |
-
✅ Verify installation:
|
| 185 |
-
|
| 186 |
-
* Windows (PowerShell)
|
| 187 |
-
|
| 188 |
-
```powershell
|
| 189 |
-
python -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors, accelerate, tensorboard, evaluate, sacrebleu, rouge_score, nltk; print('✅ All dependencies installed correctly!')"
|
| 190 |
-
```
|
| 191 |
-
|
| 192 |
-
* Linux/macOS
|
| 193 |
-
|
| 194 |
-
```bash
|
| 195 |
-
python3 -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors, accelerate, tensorboard, evaluate, sacrebleu, rouge_score, nltk; print('✅ All dependencies installed correctly!')"
|
| 196 |
-
```
|
| 197 |
-
|
| 198 |
-
---
|
| 199 |
-
|
| 200 |
-
## Usage
|
| 201 |
-
|
| 202 |
-
* Train and evaluate a question generation model.
|
| 203 |
-
* Develop Vietnamese NLP tools.
|
| 204 |
-
* Conduct linguistic research.
|
| 205 |
-
|
| 206 |
-
### Training (Fine-tuning)
|
| 207 |
-
|
| 208 |
-
When you run `fine_tune_qg.py`, the script will:
|
| 209 |
-
|
| 210 |
-
1. Load the dataset from **`30ktrain.json`**
|
| 211 |
-
2. Fine-tune the `VietAI/vit5-base` model
|
| 212 |
-
3. Save the trained model into a new folder named **`t5-viet-qg-finetuned/`**
|
| 213 |
-
|
| 214 |
-
Run:
|
| 215 |
-
|
| 216 |
-
```bash
|
| 217 |
-
python fine_tune_qg.py
|
| 218 |
-
```
|
| 219 |
-
|
| 220 |
-
### Generating Questions
|
| 221 |
-
|
| 222 |
-
```bash
|
| 223 |
-
python generate_question.py
|
| 224 |
-
```
|
| 225 |
-
|
| 226 |
-
**Example:**
|
| 227 |
-
|
| 228 |
-
```
|
| 229 |
-
Input passage:
|
| 230 |
-
Iced milk coffee (Cà phê sữa đá) is a famous drink in Vietnam.
|
| 231 |
-
|
| 232 |
-
Number of questions: 5
|
| 233 |
-
```
|
| 234 |
-
|
| 235 |
-
✅ Output:
|
| 236 |
-
|
| 237 |
-
1. What type of coffee is famous in Vietnam?
|
| 238 |
-
2. Why is iced milk coffee popular?
|
| 239 |
-
3. What ingredients are included in iced milk coffee?
|
| 240 |
-
4. Where does iced milk coffee originate from?
|
| 241 |
-
5. How is Vietnamese iced milk coffee prepared?
|
| 242 |
-
|
| 243 |
-
---
|
| 244 |
-
|
| 245 |
-
## ⚙️ Generation Settings
|
| 246 |
-
|
| 247 |
-
In `generate_question.py`, you can adjust:
|
| 248 |
-
|
| 249 |
-
* `top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty`
|
| 250 |
-
|
| 251 |
-
---
|
| 252 |
-
|
| 253 |
-
## 🤝 Contribution
|
| 254 |
-
|
| 255 |
-
We welcome contributions:
|
| 256 |
-
|
| 257 |
-
* Open issues
|
| 258 |
-
* Submit pull requests
|
| 259 |
-
* Suggest improvements or add datasets
|
| 260 |
-
|
| 261 |
-
---
|
| 262 |
-
|
| 263 |
-
## 📄 Citation
|
| 264 |
-
|
| 265 |
-
If you use this repository or datasets in research, please cite:
|
| 266 |
-
|
| 267 |
-
**Ha Nguyen-Tien, Phuc Le-Hong, Dang Do-Cao, Cuong Nguyen-Hung, Chung Mai-Van. 2025. A Method to Build QA Corpora for Low-Resource Languages. Proceedings of KSE 2025. ACM TALLIP.**
|
| 268 |
-
|
| 269 |
-
### 📚 BibTeX
|
| 270 |
-
|
| 271 |
-
```bibtex
|
| 272 |
-
@inproceedings{nguyen2025hvuqa,
|
| 273 |
-
title={A Method to Build QA Corpora for Low-Resource Languages},
|
| 274 |
-
author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van},
|
| 275 |
-
booktitle={Proceedings of KSE 2025},
|
| 276 |
-
year={2025}
|
| 277 |
-
}
|
| 278 |
-
```
|
| 279 |
-
|
| 280 |
-
---
|
| 281 |
-
|
| 282 |
-
## 📬 Contact
|
| 283 |
-
|
| 284 |
-
* **Ha Nguyen-Tien** (Corresponding author)
|
| 285 |
-
📧 [nguyentienha@hvu.edu.vn](mailto:nguyentienha@hvu.edu.vn)
|
| 286 |
-
|
| 287 |
-
* **Phuc Le-Hong**
|
| 288 |
-
📧 [Lehongphuc20021408@gmail.com](mailto:Lehongphuc20021408@gmail.com)
|
| 289 |
-
|
| 290 |
-
* **Dang Do-Cao**
|
| 291 |
-
📧 [docaodang532001@gmail.com](mailto:docaodang532001@gmail.com)
|
| 292 |
-
|
| 293 |
-
📍 Faculty of Engineering and Technology, Hung Vuong University, Phu Tho, Vietnam
|
| 294 |
-
🌐 [https://hvu.edu.vn](https://hvu.edu.vn)
|
| 295 |
-
|
| 296 |
-
---
|
| 297 |
-
|
| 298 |
-
*This repository is part of our ongoing effort to support Vietnamese NLP and make language technology more accessible for low-resource and underrepresented languages.*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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