{"id":13754286,"url":"https://github.com/RUCKBReasoning/SubgraphRetrievalKBQA","last_synced_at":"2025-05-09T22:31:49.779Z","repository":{"id":40344684,"uuid":"464142079","full_name":"RUCKBReasoning/SubgraphRetrievalKBQA","owner":"RUCKBReasoning","description":"The pytorch implementation of Subgraph Retrieval Enhanced Model for Multi-hop Knowledge Base Question Answering ","archived":false,"fork":false,"pushed_at":"2022-10-01T10:58:56.000Z","size":19627,"stargazers_count":97,"open_issues_count":9,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T07:33:19.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RUCKBReasoning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-27T13:19:07.000Z","updated_at":"2024-11-11T03:40:47.000Z","dependencies_parsed_at":"2023-01-19T01:30:16.452Z","dependency_job_id":null,"html_url":"https://github.com/RUCKBReasoning/SubgraphRetrievalKBQA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUCKBReasoning%2FSubgraphRetrievalKBQA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUCKBReasoning%2FSubgraphRetrievalKBQA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUCKBReasoning%2FSubgraphRetrievalKBQA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUCKBReasoning%2FSubgraphRetrievalKBQA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RUCKBReasoning","download_url":"https://codeload.github.com/RUCKBReasoning/SubgraphRetrievalKBQA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253335767,"owners_count":21892729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T09:01:53.209Z","updated_at":"2025-05-09T22:31:44.758Z","avatar_url":"https://github.com/RUCKBReasoning.png","language":"Python","funding_links":[],"categories":["知识图谱问答KBQA、多跳推理"],"sub_categories":["其他_文本生成、文本对话"],"readme":"\n# Dataset\n## QA benchmark\n1. WebQuestionSP：Same as the original [WebQuestionSP QA dataset](https://www.microsoft.com/en-us/download/details.aspx?id=52763).\n2. CWQ: Same as the original [CWQ dataset](https://allenai.org/data/complexwebquestions).\n\n## KG\n1. Setup Freebase: We use the whole freebase as the knowledge base. Please follow [Freebase-Setup](https://github.com/dki-lab/Freebase-Setup) to build a Virtuoso for the Freebase dataset. \n2. To improve the data accessing efficiency, we extract a 2-hop topic-centric subgraph for each question in WebQSP and a 4-hop topic-centric subgraph for each question in CWQ to create relatively small knowledge graphs. We extract these small knowledge graphs following [NSM](https://github.com/RichardHGL/WSDM2021_NSM). You can download the graphs from [here](https://drive.google.com/drive/folders/1qNauEQJHuMs4uPQcCtMb-M9Seco5mTUl?usp=sharing).\n\n# Running Instructions for WebQSP\n## Step0: Prepare the weak-supervised dataset for training the retriever：\n## cd WebQSP Q, run the following scripts.\n\n    python run_preprocess.py\n\n## Step1: Train the retriever：\n\n    python run_train_retriever.py\n\n## Step2: Extract a subgraph for each data instance：\n\n    python run_retrieve_subgraph.py\n\n## Step3: Train the reasoner：\n\n    python run_train_nsm.py\n\n## Step4: Fine-tune the retriever by the feeback of the reasoner：\n\n    python run_retriever_finetune.py\n\n## You can also directly run：\n    \n    ./run.sh\n\n## Download the data folder tmp from [here](https://drive.google.com/drive/folders/1qNauEQJHuMs4uPQcCtMb-M9Seco5mTUl?usp=sharing).\n\n## For CWQ, you can run ./cwq/run.sh\n       \n### If you have any questions about the code, please contact Xiaokang Zhang (zhang2718@ruc.edu.cn)! \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRUCKBReasoning%2FSubgraphRetrievalKBQA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRUCKBReasoning%2FSubgraphRetrievalKBQA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRUCKBReasoning%2FSubgraphRetrievalKBQA/lists"}