This is the implementation of the paper "Trigger3: Refining Query Correction via Adaptive Model Selector" based on PyTorch.
Check folder dataset for details.
Because the base model environment conflicts, you need to check it according to the requirements in the corresponding folder.
# e.g. GECToR
conda create -n GECToR python=3.8
conda activate GECToR
pip install -r requirements_gector.txt
# GECToR
sh model/GECToR/train_gector.sh
# BART
sh model/BART/train_bart.sh
# mT5
sh model/mT5/train_mt5.shCheck folder model/GECToR, model/BART, model/mT5 for details.
The fine-tuing process of LLMs is based on the open-sourced LLaMA-Factory.
The Qwen1.5-7b-chat and Baichuan2-7b-chat can be downloaded from huggingface.
# Qwen
sh model/LLaMA-Factory/sft_qwen.sh
# Baichuan
sh model/LLaMA-Factory/sft_baichuan.shCheck folder model/LLaMA-Factory for details.
# train dataset construct
sh ChERRANT/qq_train_trigger_char.sh
sh ChERRANT/qq_train_trigger_data_construct.sh
# train
sh model/Trigger/train_trigger.shCheck folder model/Trigger for details.
sh model/Trigger/Trigger3.shCheck folder model/Trigger for details.
sh ChERRANT/qq_test.shWe conducted the experiments based on the following environments:
- CUDA Version: 11.8
- OS: Ubuntu 18.04.4 LTS
- GPU: The NVIDIA Tesla V100 GPUs
- CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz