百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

DecomP

> 编程语言
开源

分解提示的存储库

100 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

分解提示的存储库

DecomP

Repository for Decomposed Prompting

Setup

  1. Install the required dependencies
    bash
    conda create -n decomp python=3.8
    pip install -r requirements.txt
  2. Set the necessary env variables
    bash
    export PYTHONPATH=src/
    export OPENAI_API_KEY=

Running Inference

Letter Concatenation

Run the letter concatenation experiments with one of the prompts

bash
    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.json

Change 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.

List Reversal

Run the list reversal experiments on sequences of length LEN using prompting strategy STRAT (STRAT should be one of decomp, cot, unrolled).

…

CommAQA

Run the CommAQA experiments with one of the prompts

bash
    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.json

Change 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.

Multi-hop Open Domain QA

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· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言