{"id":28653898,"url":"https://github.com/tiger-ai-lab/kb-binder","last_synced_at":"2025-06-13T07:08:04.188Z","repository":{"id":161302396,"uuid":"636029245","full_name":"TIGER-AI-Lab/KB-BINDER","owner":"TIGER-AI-Lab","description":"\"Few-shot In-context Learning for Knowledge Base Question Answering\" [ACL2023]","archived":false,"fork":false,"pushed_at":"2025-01-27T03:47:10.000Z","size":1737,"stargazers_count":60,"open_issues_count":6,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-27T04:25:42.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TIGER-AI-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-04T01:29:30.000Z","updated_at":"2025-01-27T03:47:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f764e44f-95e7-49ef-b2a1-23b8e0963b78","html_url":"https://github.com/TIGER-AI-Lab/KB-BINDER","commit_stats":null,"previous_names":["tiger-ai-lab/kb-binder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TIGER-AI-Lab/KB-BINDER","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FKB-BINDER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FKB-BINDER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FKB-BINDER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FKB-BINDER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TIGER-AI-Lab","download_url":"https://codeload.github.com/TIGER-AI-Lab/KB-BINDER/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIGER-AI-Lab%2FKB-BINDER/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259599331,"owners_count":22882357,"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":"2025-06-13T07:08:03.484Z","updated_at":"2025-06-13T07:08:04.149Z","avatar_url":"https://github.com/TIGER-AI-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KB-BINDER\nThe implementation for ACL2023 paper [Few-shot In-context Learning for Knowledge Base Question Answering](http://arxiv.org/abs/2305.01750)\n\u003cimg width=\"1237\" alt=\"KBQA-BINDER\" src=\"https://github.com/ltl3A87/KB-BINDER/assets/55973524/d9ceefbe-392e-4749-bf1f-58a93e97b254\"\u003e\n\n## Set up\n\n1. Set up the knowledge base server: Follow [Freebase Setup](https://github.com/dki-lab/Freebase-Setup) to set up a Virtuoso triplestore service. After starting your virtuoso service, replace the url in `sparql_executer.py` with your own.\n2. Download GrailQA/WebQSP/GraphQA/MetaQA and other required files from the [link](https://drive.google.com/drive/folders/1g8ZpMLSw95KwjisXEw07rVVC3TJ1LZdn?usp=sharing) and put them under `data/`.\n3. Install all required libraries:\n```\n$ pip install -r requirements.txt\n```\nYou can download the index file and put it under `contriever_fb_relation\n/freebase_contriever_index/` with this [link](https://drive.google.com/file/d/1hnyW-_k0YaAUZDTdYzhbKDTnFuLEW-W2/view?usp=sharing).\n\n## Run Experiments\n\n### KB-BINDER:\n```\n$ python3 few_shot_kbqa.py --shot_num 40 --temperature 0.3 \\\n --api_key [your api key] --engine [engine model name] \\\n --train_data_path [your train data path] --eva_data_path [your eva data path] \\\n --fb_roles_path [your freebase roles file path] --surface_map_path [your surface map file path]\n```\n\n### KB-BINDER-R:\n```\n$ python3 few_shot_kbqa.py --shot_num 40 --temperature 0.3 \\\n --api_key [your api key] --engine [engine model name] --retrieval \\\n --train_data_path [your train data path] --eva_data_path [your eva data path] \\\n --fb_roles_path [your freebase roles file path] --surface_map_path [your surface map file path]\n```\n\n\nAs the codex API has been closed, you may use other engine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fkb-binder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiger-ai-lab%2Fkb-binder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiger-ai-lab%2Fkb-binder/lists"}