简体中文
论文:https://arxiv.org/pdf/2305.15294
servers/custom/src/custom.py
@app.tool(output="q_ls,ret_psg->nextq_ls") def iterretgen_nextquery( q_ls: List[str], ans_ls: List[str | Any], ) -> Dict[str, List[str]]: ret = [] for q, ans in zip(q_ls, ans_ls): next_query = f"{q} {ans}" ret.append(next_query) return {"nextq_ls": ret}
examples/
IterRetGen.yaml
# IterRetGen demo # MCP Server servers: benchmark: servers/benchmark retriever: servers/retriever prompt: servers/prompt generation: servers/generation evaluation: servers/evaluation custom: servers/custom # MCP Client Pipeline pipeline: - benchmark.get_data - retriever.retriever_deploy_search - prompt.qa_rag_boxed - generation.generate - custom.output_extract_from_boxed - loop: times: 3 steps: - custom.iterretgen_nextquery: input: ans_ls: pred_ls - retriever.retriever_deploy_search: input: query_list: nextq_ls - prompt.qa_rag_boxed - generation.generate - custom.output_extract_from_boxed - evaluation.evaluate
ultrarag build examples/IterRetGen.yaml
examples/parameter/IterRetGen_parameter.yaml
benchmark: benchmark: key_map: gt_ls: golden_answers q_ls: question limit: 2 name: asqa path: data/sample_asqa_5.jsonl custom: {} evaluation: metrics: - acc - f1 - em - coverem - stringem - rouge-1 - rouge-2 - rouge-l save_path: output/asqa.json generation: base_url: http://localhost:8000/v1 model_name: openbmb/MiniCPM4-8B sampling_params: extra_body: chat_template_kwargs: enable_thinking: false include_stop_str_in_output: true top_k: 20 max_tokens: 2048 temperature: 0.7 top_p: 0.8 prompt: template: prompt/qa_boxed.jinja retriever: query_instruction: 'Query: ' retriever_url: http://localhost:8080 top_k: 5
ultrarag run examples/IterRetGen.yaml
此页面对您有帮助吗?