If you find this project useful for your research, please consider citing the following paper:
@inproceedings{qin-etal-2023-cross,
title = "Cross-lingual Prompting: Improving Zero-shot Chain-of-Thought Reasoning across Languages",
author = "Qin, Libo and
Chen, Qiguang and
Wei, Fuxuan and
Huang, Shijue and
Che, Wanxiang",
editor = "Bouamor, Houda and
Pino, Juan and
Bali, Kalika",
booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
month = dec,
year = "2023",
address = "Singapore",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.emnlp-main.163",
doi = "10.18653/v1/2023.emnlp-main.163",
pages = "2695--2709",
}
git clone https://github.com/LightChen233/cross-lingual-prompting.git && cd cross-lingual-prompting/
pip install -r requirements.txt
python metric.py --dataset-name mgsm \
--exp-name CLSP
Parameters:
dataset-name
: dataset name.exp-name
: experiment names, which are selected from['CLP', 'CLSP']
, .
python request.py --api-key sk-xxx \
--input-dir mgsm/input \
--output-dir mgsm/output \
--parallel-num 10
Parameters:
api-key
: OpenAI API-KEYinput-dir
: original data dir pathoutput-dir
: generated data dir path to saveparallel-num
: the parallel thread number of request
python merge.py --input-dir mgsm/output \
--output-dir mgsm/output \
--parallel-num 10
Parameters:
input-dir
: generated data dir path to merge, which equals tooutput-dir
in step 1.output-dir
: generated data dir path to save.parallel-num
: the parallel thread number of request, which equals toparallel-num
in step 1.
python metric.py --input-dir mgsm/output \
--metric-mode common
Parameters:
input-dir
: generated data dir path to save, which equals tooutput-dir
in step 2.metric-mode
: selected from['common', 'clsp']
,common
denotes the regular CoT metrics andclsp
denotes the vote mechanism for CLSP. Parameters:api-key
: OpenAI API-KEYinput-dir
: original data dir pathoutput-dir
: generated data dir path to saveparallel-num
: the parallel thread number of request
Please create Github issues here or email Qiguang Chen or Libo Qin if you have any questions or suggestions.