DANGDOCAO commited on
Commit
ce03d4d
·
verified ·
1 Parent(s): df411b0

update README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -0
README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ---
36
+
37
+ ## 📋 Dataset Description
38
+
39
+ - **Language:** Vietnamese
40
+ - **Format:** SQuAD-style JSON
41
+ - **Size:** 30,000 QCA triples
42
+ - **Domains:** Social services, labor law, administrative processes, and public service topics.
43
+
44
+ Each data sample contains:
45
+ - `question`: The generated or extracted question
46
+ - `context`: The supporting passage
47
+ - `answer`: The answer span within the context
48
+
49
+ ---
50
+
51
+ ## ⚙️ Dataset Creation
52
+
53
+ **Pipeline:**
54
+ 1. Selecting relevant QA websites from trusted sources
55
+ 2. Automated crawling to collect raw QA webpages
56
+ 3. Semantic tag-based extraction to get clean QCA triples
57
+ 4. AI-assisted filtering to remove noisy or inconsistent samples
58
+
59
+ **Annotation & Licensing:**
60
+ All data are collected from public-domain Vietnamese government and service portals, released under CC BY 4.0.
61
+
62
+ ---
63
+
64
+ ## 📊 Quality Evaluation
65
+
66
+ A fine-tuned `VietAI/vit5-base` model trained on HVU_QA achieved:
67
+
68
+ | Metric | Score |
69
+ |-----------------------|-------------|
70
+ | BLEU | 90.61 |
71
+ | Semantic similarity | 97.0% (cos ≥ 0.8) |
72
+ | Human grammar | 4.58 / 5 |
73
+ | Human usefulness | 4.29 / 5 |
74
+
75
+ ---
76
+
77
+ ## 📁 Data Fields
78
+
79
+ ```json
80
+ {
81
+ "question": "string",
82
+ "context": "string",
83
+ "answer": "string"
84
+ }
85
+ ```
86
+
87
+ - `question`: The question text
88
+ - `context`: The paragraph containing the answer
89
+ - `answer`: The answer span
90
+
91
+ ---
92
+
93
+ ## 🧩 How to Use
94
+
95
+ ### Load from Hub
96
+
97
+ ```python
98
+ from datasets import load_dataset
99
+ ds = load_dataset("DANGDOCAO/GeneratingQuestions", split="train")
100
+ print(ds[0])
101
+ ```
102
+
103
+ ### Install Dependencies
104
+
105
+ ```bash
106
+ pip install datasets transformers sentencepiece safetensors accelerate evaluate sacrebleu rouge-score nltk scikit-learn
107
+ ```
108
+
109
+ (Optional) Install PyTorch separately from [pytorch.org](https://pytorch.org)
110
+
111
+ ---
112
+
113
+ ## 🚀 Example Usage
114
+
115
+ ### Fine-tune a Question Generation Model
116
+
117
+ ```bash
118
+ python fine_tune_qg.py
119
+ ```
120
+
121
+ This will:
122
+ 1. Load data from `30ktrain.json`
123
+ 2. Fine-tune `VietAI/vit5-base`
124
+ 3. Save model to `t5-viet-qg-finetuned/`
125
+
126
+ ### Generate Questions
127
+
128
+ ```bash
129
+ python generate_question.py
130
+ ```
131
+
132
+ **Example**
133
+ ```
134
+ Input passage:
135
+ Iced milk coffee (Cà phê sữa đá) is a famous drink in Vietnam.
136
+ Number of questions: 5
137
+ ```
138
+
139
+ **Output**
140
+ 1. What type of coffee is famous in Vietnam?
141
+ 2. Why is iced milk coffee popular?
142
+ 3. What ingredients are included in iced milk coffee?
143
+ 4. Where does iced milk coffee originate from?
144
+ 5. How is Vietnamese iced milk coffee prepared?
145
+
146
+ **You can adjust** in `generate_question.py`:
147
+ `top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty`
148
+
149
+ ---
150
+
151
+ ## 📌 Citation
152
+
153
+ If you use **HVU_QA** in your research:
154
+
155
+ ```bibtex
156
+ @inproceedings{nguyen2025hvuqa,
157
+ title={A Method to Build QA Corpora for Low-Resource Languages},
158
+ author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van},
159
+ booktitle={Proceedings of the International Conference on Knowledge and Systems Engineering (KSE)},
160
+ year={2025}
161
+ }
162
+ ```