DANGDOCAO commited on
Commit
fa731c5
·
verified ·
1 Parent(s): 0087be2

update README.md

Browse files
Files changed (1) hide show
  1. README.md +179 -0
README.md ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: HVU_QA
3
+ language:
4
+ - vi
5
+ tags:
6
+ - question-generation
7
+ - nlp
8
+ - faq
9
+ - low-resource
10
+ license: cc-by-4.0
11
+ task_categories:
12
+ - question-generation
13
+ task_ids:
14
+ - text2text-generation
15
+ size_categories:
16
+ - 10K<n<100K
17
+ dataset_info:
18
+ features:
19
+ - name: question
20
+ dtype: string
21
+ - name: context
22
+ dtype: string
23
+ - name: answer
24
+ dtype: string
25
+ splits:
26
+ - name: train
27
+ num_examples: 30000
28
+ ---
29
+
30
+ # HVU_QA
31
+
32
+ **HVU_QA** is an open-source Vietnamese Question–Context–Answer (QCA) corpus for building FAQ-style question generation systems in low-resource languages.
33
+ It was created using a fully automated pipeline combining web crawling, semantic tag-based extraction, and AI-assisted filtering to ensure high factual accuracy.
34
+
35
+ ## Dataset Description
36
+
37
+ - Language: Vietnamese
38
+ - Format: SQuAD-style JSON
39
+ - Size: 30,000 QCA triples
40
+ - Domains: Social services, labor law, administrative processes, and public service topics
41
+
42
+ Each data sample contains:
43
+ - `question`: The generated or extracted question
44
+ - `context`: The supporting passage
45
+ - `answer`: The answer span within the context
46
+
47
+ ## Dataset Creation
48
+
49
+ **Pipeline:**
50
+ 1. Selecting relevant QA websites from trusted sources
51
+ 2. Automated crawling to collect raw QA webpages
52
+ 3. Semantic tag-based extraction to get clean QCA triples
53
+ 4. AI-assisted filtering to remove noisy or inconsistent samples
54
+
55
+ **Annotation & Licensing:**
56
+ All data are collected from public-domain Vietnamese government and service portals, released under CC BY 4.0.
57
+
58
+ ## Quality Evaluation
59
+
60
+ A fine-tuned `VietAI/vit5-base` model trained on **HVU_QA** was used to validate the dataset quality.
61
+
62
+ **Automatic metrics:**
63
+
64
+ | Metric | Score |
65
+ |-----------------------|----------------------|
66
+ | BLEU | 90.61 |
67
+ | Semantic similarity | 97.0% (cosine ≥ 0.8) |
68
+
69
+ **Human evaluation (1–5 scale):**
70
+
71
+ | Aspect | Avg. Score |
72
+ |------------------|-------------|
73
+ | Grammaticality | 4.58 / 5 |
74
+ | Usefulness | 4.29 / 5 |
75
+
76
+ These results confirm that **HVU_QA** is a high-quality resource for developing robust FAQ-style question generation models.
77
+
78
+ ## Setup
79
+
80
+ ### Step 1 — Clone repository (optional if local)
81
+
82
+ ```bash
83
+ git clone https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions
84
+ cd GeneratingQuestions
85
+ ```
86
+
87
+ ### Step 2 — Install dependencies
88
+
89
+ **Minimal:**
90
+ ```bash
91
+ python -m pip install --upgrade pip
92
+ pip install datasets transformers sentencepiece safetensors
93
+ ```
94
+
95
+ **Recommended (for training & evaluation):**
96
+ ```bash
97
+ pip install datasets transformers sentencepiece safetensors accelerate evaluate sacrebleu rouge-score nltk tensorboard scikit-learn
98
+ ```
99
+
100
+ **Install PyTorch (choose CUDA/CPU from https://pytorch.org):**
101
+ ```bash
102
+ pip install torch
103
+ ```
104
+
105
+ ### Step 3 — (Optional) Configure environment
106
+
107
+ ```bash
108
+ pip install -U huggingface_hub
109
+ huggingface-cli login
110
+ git lfs install
111
+ ```
112
+
113
+ Only needed if you want to push to Hub or download private models.
114
+
115
+ ### Step 4 — Download data
116
+
117
+ ```python
118
+ from datasets import load_dataset
119
+ ds = load_dataset("DANGDOCAO/GeneratingQuestions", split="train")
120
+ print(ds[0])
121
+ ```
122
+
123
+ Or from local JSON:
124
+ ```python
125
+ ds = load_dataset("json", data_files="30ktrain.json", split="train")
126
+ ```
127
+
128
+ ### Step 5 — Verify installation
129
+
130
+ ```bash
131
+ python -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors; print('All installed OK!')"
132
+ ```
133
+
134
+ ## Usage
135
+
136
+ ### Fine-tune model
137
+
138
+ ```bash
139
+ python fine_tune_qg.py
140
+ ```
141
+
142
+ This will:
143
+ 1. Load data from `30ktrain.json`
144
+ 2. Fine-tune `VietAI/vit5-base`
145
+ 3. Save model to `t5-viet-qg-finetuned/`
146
+
147
+ ### Generate questions
148
+
149
+ ```bash
150
+ python generate_question.py
151
+ ```
152
+
153
+ Example
154
+ ```
155
+ Input passage:
156
+ Iced milk coffee (Cà phê sữa đá) is a famous drink in Vietnam.
157
+ Number of questions: 5
158
+ ```
159
+
160
+ Output
161
+ 1. What type of coffee is famous in Vietnam?
162
+ 2. Why is iced milk coffee popular?
163
+ 3. What ingredients are included in iced milk coffee?
164
+ 4. Where does iced milk coffee originate from?
165
+ 5. How is Vietnamese iced milk coffee prepared?
166
+
167
+ Adjustable parameters (`generate_question.py`):
168
+ `top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty`
169
+
170
+ ## Citation
171
+
172
+ ```bibtex
173
+ @inproceedings{nguyen2025hvuqa,
174
+ title={A Method to Build QA Corpora for Low-Resource Languages},
175
+ author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van},
176
+ booktitle={Proceedings of the International Conference on Knowledge and Systems Engineering (KSE)},
177
+ year={2025}
178
+ }
179
+ ```