
pip install -r requirements.txtmain.pyЭксперименты Time Qu
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
Запустить эксперименты по температуру и временным вопросам
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 имеют другое поведение, их способность к обучению в контексте стала ухудшением и не может правильно выполнить задачу.
Пожалуйста, цитируйте газету и составьте эту репо, если вы найдете 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 }
}