
pip install -r requirements.txtmain.pyExperimentos de execução do 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
Execute experiências de Tempernom
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
A saída deve parecer
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)}})
'''
...
Defina o file_path em calc_metrics_with_check_and_match.py e execute -o.
Neste trabalho, nos concentramos no controle de qualidade restrito. No entanto, nossa estrutura pode ser modificada para generalizar para outras tarefas de controle de qualidade restritas. A chave é definir a restrição como uma classe Python, que deve ser capaz de ser medida o quão bem a restrição é satisfeita e redefinir a função match em calc_metrics_with_check_and_match.py .
Executamos todos os experimentos com gpt-3.5-turbo-0301 . No entanto, descobrimos que as versões atualizadas como gpt-3.5-turbo-0613 e gpt-3.5-turbo-1106 têm um comportamento diferente, sua capacidade de aprendizado no contexto se degradou e não pode executar corretamente a tarefa.
Por favor, cite o papel e estrela este repositório se achar o QAAP interessante ou útil, obrigado! Sinta -se à vontade para entrar em contato com [email protected] ou abrir um problema se tiver alguma dúvida.
@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 }
}