
pip install -r requirements.txtmain.pyExperimentos de tiempo de ejecución
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
Experimentos de TempQuestions y 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
La salida debería verse como
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)}})
'''
...
Establezca el file_path en calc_metrics_with_check_and_match.py y ejecútelo.
En este trabajo, nos centramos en el control de calidad con restricciones de tiempo. Sin embargo, nuestro marco puede modificarse para generalizar a otras tareas de control de calidad basadas en restricciones. La clave es definir la restricción como una clase de Python, que debería poder medirse qué tan bien se cumple la restricción y redefinir la función de match en calc_metrics_with_check_and_match.py .
Ejecutamos todos los experimentos con gpt-3.5-turbo-0301 . Sin embargo, encontramos que las versiones actualizadas como gpt-3.5-turbo-0613 y gpt-3.5-turbo-1106 tienen un comportamiento diferente, su capacidad de aprendizaje en contexto se degrada y no puede realizar la tarea correctamente.
Por favor, cita el papel y protagonice este repositorio si encuentra que QAAP es interesante o útil, ¡gracias! No dude en comunicarse con [email protected] o abrir un problema si tiene alguna pregunta.
@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 }
}