{"id":14959105,"url":"https://github.com/yishun99/kb-qa","last_synced_at":"2025-05-01T09:16:55.896Z","repository":{"id":143240435,"uuid":"115066448","full_name":"Yishun99/KB-QA","owner":"Yishun99","description":"基于知识库的中文问答系统（biLSTM）","archived":false,"fork":false,"pushed_at":"2018-09-11T08:59:37.000Z","size":1876,"stargazers_count":246,"open_issues_count":1,"forks_count":81,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-01T09:16:50.591Z","etag":null,"topics":["bilstm","knowledge","question-answering","tensorflow-examples"],"latest_commit_sha":null,"homepage":"","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/Yishun99.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-22T02:13:35.000Z","updated_at":"2025-04-26T11:51:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"08524779-359c-48d0-9a8e-d2374fe86683","html_url":"https://github.com/Yishun99/KB-QA","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"dfa7bb6d0038d8278109a4eabdac5ed217425f36"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yishun99%2FKB-QA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yishun99%2FKB-QA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yishun99%2FKB-QA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yishun99%2FKB-QA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yishun99","download_url":"https://codeload.github.com/Yishun99/KB-QA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251850182,"owners_count":21653978,"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":["bilstm","knowledge","question-answering","tensorflow-examples"],"created_at":"2024-09-24T13:18:51.345Z","updated_at":"2025-05-01T09:16:55.876Z","avatar_url":"https://github.com/Yishun99.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knowledge-Based Question Answering\n\n基于知识库的中文问答系统.\n整体流程如下:\n1. 根据Background和Question寻找到最相关的K个Knowledge，`K Knowledge+Background+Question`构成一个`大问题`.\n2. `正确选项`分别与该问题中所有`错误选项`组合，构成3个答案组合，分别与`大问题`组合构成3个样例，采用**余弦距离**计算`大问题`与`正确选项`和`错误选项`的相似度.\n\n    正确选项相似度为t_sim, 错误选项相似度为f_sim,损失函数为\n\n        loss = max(0, margin - t_sim + f_sim)\n\n\n## Model\n- 寻找相关Knowledge: LSI\n- 训练: biLSTM\n\n## Requirement\n\n- python3, tensorflow\n- stop_words, 中文[word2vec](https://pan.baidu.com/s/1miBYRgO)(a2u6)\n\n## Data Format\n\n- knowledge\n\n        地球是宇宙中的一颗行星，有自己的运动规律。\n        地球上的许多自然现象都与地球的运动密切相关。\n        地球具有适合生命演化和人类发展的条件，因此，它成为人类在宇宙中的唯一家园。\n        ...\n\n- train\u0026test\n\n    问题为选择题，每个问题的格式为\n    `Background, Question, Right, Wrong, Wrong, Wrong`.\n\n        B:近年来，我国有些农村出现了“有院无人住，有地无人种”的空心化现象。\n        Q:“有院无人住，有地无人种”带来\n        R:土地资源浪费\n        W:农业发展水平提高\n        W:城乡协调发展\n        W:农村老龄化程度降低\n\n        B:广东省佛山市三水区被称为“中国饮料之都”。除青岛啤酒、伊利等国内著名饮料企业抢先布局外，百威、红牛、可口可乐、杨协成等国际巨头也先后落户于此，作为其在中国布局中的重要一环。\n        Q:众多国际饮料企业选址三水的主导区位因素是\n        R:市场\n        W:技术\n        W:劳动力\n        W:原料\n\n        B:凡是大气中因悬浮的水汽凝结，能见度低于1千米时，气象学称这种天气现象为雾\n        Q:深秋到第二年初春，晴朗的夜晚容易形成雾，这主要是因为\n        R:晴朗的夜晚大气逆辐射弱，近地面降温快\n        W:晴天大气中的水汽含量多\n        W:晴朗的夜晚地面水汽蒸发强\n        W:晴天大气中的凝结核物质较少\n\n        ...\n\n## Usage\n\npython3 train.py\n\n该数据集下最佳参数为\n- dropout:0.45\n- k:0.5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyishun99%2Fkb-qa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyishun99%2Fkb-qa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyishun99%2Fkb-qa/lists"}