--- license: mit language: - vi tags: - question-generation - ag, t5, vit5, squad-format, vietnamese, education, nlp pretty_name: Vietnamese Question Generation size_categories: - 10K All data files are UTF-8 encoded and ready for use in NLP pipelines. --- ## ๐Ÿ› ๏ธ Requirements * Python 3.8+ * PyTorch >= 1.9 * Transformers >= 4.30 * scikit-learn * Fine-tuned model (download at: [link](https://huggingface.co/datasets/DANGDOCAO/GeneratingQuestions/tree/main)) --- ## โš™๏ธ Setup ### ๐Ÿ› ๏ธ Step 1: Download and Extract 1. Download `HVU_QA.zip` 2. Extract into a folder, e.g.: ``` D:\your\HVU_QA ``` ### ๐Ÿ› ๏ธ Step 2: Add to Environment Path (if needed) 1. Open **System Properties โ†’ Environment Variables** 2. Select `Path` โ†’ **Edit** โ†’ **New** 3. Add the path, e.g.: ``` D:\your\HVU_QA ``` ### ๐Ÿ› ๏ธ Step 3: Open in Visual Studio Code ``` File > Open Folder > D:\HVU_QA ``` ### ๐Ÿ› ๏ธ Step 4: Install Required Libraries Open **Terminal** and run: #### Windows (PowerShell) **Required only** ```powershell python -m pip install --upgrade pip pip install torch transformers datasets scikit-learn sentencepiece safetensors ``` **Required + Optional** ```powershell python -m pip install --upgrade pip pip install torch transformers datasets scikit-learn sentencepiece safetensors accelerate tensorboard evaluate sacrebleu rouge-score nltk ``` #### Linux / macOS (bash/zsh) **Required only** ```bash python3 -m pip install --upgrade pip pip install torch transformers datasets scikit-learn sentencepiece safetensors ``` **Required + Optional** ```bash python3 -m pip install --upgrade pip pip install torch transformers datasets scikit-learn sentencepiece safetensors accelerate tensorboard evaluate sacrebleu rouge-score nltk ``` โœ… Verify installation: * Windows (PowerShell) ```powershell python -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors, accelerate, tensorboard, evaluate, sacrebleu, rouge_score, nltk; print('โœ… All dependencies installed correctly!')" ``` * Linux/macOS ```bash python3 -c "import torch, transformers, datasets, sklearn, sentencepiece, safetensors, accelerate, tensorboard, evaluate, sacrebleu, rouge_score, nltk; print('โœ… All dependencies installed correctly!')" ``` --- ## Usage * Train and evaluate a question generation model. * Develop Vietnamese NLP tools. * Conduct linguistic research. ### Training (Fine-tuning) When you run `fine_tune_qg.py`, the script will: 1. Load the dataset from **`30ktrain.json`** 2. Fine-tune the `VietAI/vit5-base` model 3. Save the trained model into a new folder named **`t5-viet-qg-finetuned/`** Run: ```bash python fine_tune_qg.py ``` ### Generating Questions ```bash python generate_question.py ``` **Example:** ``` Input passage: Iced milk coffee (Cร  phรช sแปฏa ฤ‘รก) is a famous drink in Vietnam. Number of questions: 5 ``` โœ… Output: 1. What type of coffee is famous in Vietnam? 2. Why is iced milk coffee popular? 3. What ingredients are included in iced milk coffee? 4. Where does iced milk coffee originate from? 5. How is Vietnamese iced milk coffee prepared? --- ## โš™๏ธ Generation Settings In `generate_question.py`, you can adjust: * `top_k`, `top_p`, `temperature`, `no_repeat_ngram_size`, `repetition_penalty` --- ## ๐Ÿค Contribution We welcome contributions: * Open issues * Submit pull requests * Suggest improvements or add datasets --- ## ๐Ÿ“„ Citation If you use this repository or datasets in research, please cite: **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.** ### ๐Ÿ“š BibTeX ```bibtex @inproceedings{nguyen2025hvuqa, title={A Method to Build QA Corpora for Low-Resource Languages}, author={Ha Nguyen-Tien and Phuc Le-Hong and Dang Do-Cao and Cuong Nguyen-Hung and Chung Mai-Van}, booktitle={Proceedings of KSE 2025}, year={2025} } ``` --- ## ๐Ÿ“ฌ Contact * **Ha Nguyen-Tien** (Corresponding author) ๐Ÿ“ง [nguyentienha@hvu.edu.vn](mailto:nguyentienha@hvu.edu.vn) * **Phuc Le-Hong** ๐Ÿ“ง [Lehongphuc20021408@gmail.com](mailto:Lehongphuc20021408@gmail.com) * **Dang Do-Cao** ๐Ÿ“ง [docaodang532001@gmail.com](mailto:docaodang532001@gmail.com) ๐Ÿ“ Faculty of Engineering and Technology, Hung Vuong University, Phu Tho, Vietnam ๐ŸŒ [https://hvu.edu.vn](https://hvu.edu.vn) --- *This repository is part of our ongoing effort to support Vietnamese NLP and make language technology more accessible for low-resource and underrepresented languages.*