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