NeSyGPT: A Unified Neural-Symbolic Framework for Structured Knowledge Querying with Large Language Model
pip install -r requirements.txt
NOTE: Please write the API key in api_key.txt
before running the code. And the api_key.txt
file should have the same number of keys as num_process
. The default num_process
in the following shell script is 5.
# WikiSQL
>> bash scripts/wikisql/wikisql_gpt3.5.sh
>> bash scripts/wikisql/wikisql_gpt4.sh
# WTQ
>> bash scripts/WTQ/WTQ_gpt3.5.sh
>> bash scripts/WTQ/WTQ_gpt4.sh
# MetaQA
>> bash scripts/MetaQA/metaqa_1hop.sh
>> bash scripts/MetaQA/metaqa_2hop.sh
>> bash scripts/MetaQA/metaqa_3hop.sh
# WebQSP
>> bash scripts/WQSP/wqsp3.5/WQSP_overall_gpt3.5.sh
>> bash scripts/WQSP/wqsp4/WQSP_overall_gpt4.sh
# CronQuestion
>> bash scripts/CronQuestion/CronQuestion_gpt3.5.sh
>> bash scripts/CronQuestion/CronQuestion_gpt4.sh
π π Click
root
βββ dataset
βββ evaluate
βββ output
βββ scripts
βββ structllm
β βββ prompt_
βββ api_key.txt
βββ CGdata_for_CronQuestion.py
βββ CGdata_for_KGQA.py
βββ CGdata_for_tableqa.py
βββ CGdata_for_WQSP.py
βNOTE: The data we provide is the data after conversion to CGdata.
π π Click
dataset
βββ CronQuestion_CG
β βββ kg_test.txt
β βββ kg.txt
β βββ qa_test.jsonl
β βββ qa_valid.jsonl
βββ MetaQA_CG
βββ WikiSQL_CG
βββ WikiSQL_TB_csv
βββ WQSP
βββ WTQ
βββ deal_raw.py
π π Click
evaluate
βββ evaluate_for_CronQuestion.py
βββ evaluate_for_metaqa.py
βββ evaluate_for_tableqa.py
βββ evaluate_for_wqsp.py
π π Click
prompt_
βββ MetaQA
β βββ 1hop.json
β βββ 2hop.json
β βββ 3hop.json
βββ WQSP
β βββ WQSP_name.json
β βββ WQSP_unname.json
βββ CronQuestion.json
βββ wikisql.json
βββ WTQ.json