分解提示的存储库
Repository for Decomposed Prompting
conda create -n decomp python=3.8
pip install -r requirements.txtexport PYTHONPATH=src/
export OPENAI_API_KEY=Run the letter concatenation experiments with one of the prompts
promptid=p1 python -m decomp.inference.configurable_inference \
--input datasets/letter_cat/n5_eg100_pos2_space.json \
--config configs/inference/letter_cat/letter_cat_greedy_search.jsonnet \
--output output/predictions/letter_cat_n5_eg100_pos2_space_decomp_predictions.json
python -m decomp.datasets_utils.drop_eval \
--gold_path datasets/letter_cat/n5_eg100_pos2_space.json \
--prediction_path output/predictions/letter_cat_n5_eg100_pos2_space_decomp_predictions.jsonChange promptid to p2 or p3 to try other prompts. Change config to cot_letter_cat_greedy_search to evaluate the CoT baseline and cot_rollout_letter_cat_greedy_search to evaluate the CoT w/ rollout baseline.
Run the list reversal experiments on sequences of length LEN
using prompting strategy STRAT (STRAT should be one of decomp, cot, unrolled).
…Run the CommAQA experiments with one of the prompts
promptid=p1 python -m decomp.inference.configurable_inference \
--input datasets/commaqa_e/iid_test_eg100.json \
--config configs/inference/commaqa/commaqae_fine_greedy_search.jsonnet \
--output output/predictions/commaqa_e_iid_test_eg100_fine_decomp_predictions.json
python -m decomp.datasets_utils.drop_eval \
--gold_path datasets/commaqa_e/iid_test_eg100.json \
--prediction_path output/predictions/commaqa_e_iid_test_eg100_fine_decomp_predictions.jsonChange promptid to p2 or p3 to try other prompts. Change config to cot_commaqae_greedy_search to evaluate the CoT baseline and commaqae_coarse_greedy_search to evaluate the coarse decomposition. Change the test file to datasets/commaqa_e/compgen_test_eg300.json to evaluate the compositional generalization split.
All the code and experiments for multi-hop open-domain QA can be found in Harsh's Decomp-ODQA repo here: https://github.com/HarshTrivedi/DecomP-ODQA
暂无开放 Issues,或尚未同步最近议题。