
pip install -r requirements.txtmain.pyเรียกใช้การทดลอง TimeQA
python main.py
--prompt_file timeqa.json
--given_context 1
--dataset timeqa
--data_file test_hard.jsonl
--max_slice_length 512
--slice_stride 384
--return_search_passage content
--model_name gpt-3.5-turbo
--resume_id -1
เรียกใช้การทดลอง tempquestions และ timequestions
python main.py
--prompt_file timequestions.json
--given_context 0
--dataset tempquestion
--data_file test.jsonl
--max_slice_length 512
--slice_stride 384
--return_search_passage content
--model_name gpt-3.5-turbo
--resume_id -1
เอาต์พุตควรมีลักษณะ
0 Joachim Löw was the coach of which team between Jan 1997 and Aug 1997?
'''python
query = {"subject": "Joachim Löw", "relation": "coach of", "object": None, "time": {"start": datetime(1997, 1, 1), "end": datetime(1997, 8, 31)}}
answer_key = "object"
'''
Search:
'''python
entities_to_search = ["Joachim Löw"]
'''
--------------------------------------------------
Generate a background document from Wikipedia to answer the given question:Joachim Löw is a German football coach and former player. He was the head coach of VfB Stuttgart from July 1996 to October 1998.
Extract information relevant to the query:
'''python
information.append({"subject": "Joachim Löw", "relation": "coach of", "object": "VfB Stuttgart", "time": {"start": datetime(1996, 7, 1), "end": datetime(1998, 10, 31)}})
'''
**************************************************
Extract information relevant to the query:
'''python
information.append({"subject": "Joachim Löw", "relation": "coach of", "object": None, "time": {"start": datetime(1997, 1, 1), "end": datetime(1997, 8, 31)}})
'''
...
ตั้งค่า file_path ใน calc_metrics_with_check_and_match.py และดำเนินการ
ในงานนี้เรามุ่งเน้นไปที่ QA ที่ จำกัด เวลา อย่างไรก็ตามเฟรมเวิร์กของเราสามารถปรับเปลี่ยนเพื่อทั่วไปไปยังงาน QA ที่มีข้อ จำกัด อื่น ๆ กุญแจสำคัญคือการกำหนดข้อ จำกัด เป็นคลาส Python ซึ่งควรจะสามารถวัดได้ว่าข้อ จำกัด นั้นเป็นที่พอใจและกำหนดฟังก์ชั่น match ใหม่ใน calc_metrics_with_check_and_match.py
เราทำการทดลองทั้งหมดด้วย gpt-3.5-turbo-0301 อย่างไรก็ตามเราพบเวอร์ชันที่อัปเดตเช่น gpt-3.5-turbo-0613 และ gpt-3.5-turbo-1106 มีพฤติกรรมที่แตกต่างกันความสามารถในการเรียนรู้ในบริบทของพวกเขากลายเป็นความเสื่อมโทรมและไม่สามารถทำงานได้อย่างถูกต้อง
โปรดอ้างอิงกระดาษและแสดง repo นี้หากคุณพบว่า QAAP น่าสนใจหรือมีประโยชน์ขอบคุณ! อย่าลังเลที่จะติดต่อ [email protected] หรือเปิดปัญหาหากคุณมีคำถามใด ๆ
@article { zhu2023qaap ,
title = { Question Answering as Programming for Solving Time-Sensitive Questions } ,
author = { Zhu, Xinyu and Yang, Cheng and Chen, Bei and Li, Siheng and Lou, Jian-Guang and Yang, Yujiu } ,
journal = { arXiv preprint arXiv:2305.14221 } ,
year = { 2023 }
}