نقترح اتباع نهج لإعادة تشغيل صفرية وضعة طلقة لمسارات المستندات متعددة القوانين ل QA للمجال المفتوح. يقوم ProMptrank بإنشاء مطالبة تتكون من (1) تعليمات و (2) المسار ويستخدم LLM لتسجيل مسارات كاحتمال توليد السؤال الممنوح.

قم بتنزيل TF-IDF Retriever وقاعدة البيانات لـ Hotpotqa المقدمة من Pathretriever من هذا الرابط ووضع محتوياته في path-retriever/models
pip install -r requirements.txt
يمكن تنزيل بيانات HotpotQA و 2Wikimqa المعالجة من [Google Drive] ، يتم معالجة البيانات مسبقًا عن طريق استرداد 200 مقال TF-IDF لزيادة الاستدلال. (https://drive.google.com/file/d/1mi7xadhwlhlw6fmow3ljqmpipsmlnp67/view؟usp=share_link). ثم قم بفك ضغط البيانات ووضع المحتوى في data/
python run.py
--model google/t5-base-lm-adapt
--eval_batch_size=50
--max_prompt_len 600
--max_doc_len 230
--tfidf_pool_size 100
--n_eval_examples 1000
--temperature 1.0
--eval_data data/hotpotqa/dev.json
--prompt_template 'Document: <P> Review previous documents and ask some question. Question:'
python run.py
--model google/t5-base-lm-adapt
--eval_batch_size=50
--max_prompt_len 600
--max_doc_len 230
--tfidf_pool_size 100
--n_eval_examples 1000
--temperature 1.0
--eval_data data/hotpotqa/dev.json
--instruction_template_file instruction-templates/top_instructions.txt
--ensemble_prompts
يستخدم هذا أعلى 10 تعليمات موجودة عبر Hotpotqa والتي هي في instruction-templates/top_instructions.txt :
Document : < P > Review previous documents and ask some question . Question
Document : < P > Review the previous documents and answer question . Question :
Document : < P > Read the previous documents and write the following question . Question :
Document : < P > Search previous documents and ask the question . Question :
To analyze the documents and ask question . Document : < P > Question :
Document : < P > To read the previous documents and write a question . Question :
Document : < P > Read previous documents and write your exam question . Question :
Document : < P > Read the previous documents and ask this question . Question :
Read two documents and answer a question . Document : < P > Question :
Identify all documents and ask question . Document : < P > Question : python run.py
--model google/t5-base-lm-adapt
--eval_batch_size=50
--max_prompt_len 600
--max_doc_len 230
--tfidf_pool_size 100
--n_eval_examples 1000
--temperature 1.0
--eval_data data/hotpotqa/dev.json
--prompt_template 'Document: <P> Review previous documents and ask some question. Question:'
--demos_ids 0,1
--demos_file data/hotpotqa/in_context_demos.json
python run.py
--model google/t5-base-lm-adapt
--eval_batch_size=50
--max_prompt_len 600
--max_doc_len 230
--tfidf_pool_size 100
--n_eval_examples 1000
--temperature 1.0
--eval_data data/hotpotqa/dev.json
--prompt_template 'Document: <P> Review previous documents and ask some question. Question:'
--demos_ids 0,1
--demos_file data/hotpotqa/in_context_demos.json
--n_ensemble_demos 3
ملاحظة: يدعم الرمز إما تعليمات الفرقة أو الفرقة العرضية - وليس كلاهما.
نستخدم العديد من المكونات من Pathretriever. لذا بفضل Akari Asai وغيرهم على توفير الكود والنماذج الخاصة بهم.
إذا كنت تستخدم هذا الرمز ، فيرجى التفكير في ذكر ورقتنا:
@article{promptrank,
title={Few-shot Reranking for Multi-hop QA via Language Model Prompting},
author={Khalifa, Muhammad and Logeswaran, Lajanugen and Lee, Moontae and Lee, Honglak and Wang, Lu},
journal={arXiv preprint arXiv:2205.12650},
year={2023}
}