• 大小: 18.50M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-30
  • 语言: Python
  • 标签:

资源简介

Python Neo4j医药知识图谱自动问答系统源码,知识图谱构建,自动问答,基于kg的自动问答。以疾病为中心的一定规模医药领域知识图谱,并以该知识图谱完成自动问答与分析服务。

资源截图

代码片段和文件信息

#!/usr/bin/env python3
# coding: utf-8
# File: answer_search.py
# Author: lhy
# Date: 18-10-5

from py2neo import Graph

class AnswerSearcher:
    def __init__(self):
        self.g = Graph(
            host=“127.0.0.1“
            http_port=7474
            user=“lhy“
            password=“lhy123“)
        self.num_limit = 20

    ‘‘‘执行cypher查询,并返回相应结果‘‘‘
    def search_main(self sqls):
        final_answers = []
        for sql_ in sqls:
            question_type = sql_[‘question_type‘]
            queries = sql_[‘sql‘]
            answers = []
            for query in queries:
                ress = self.g.run(query).data()
                answers += ress
            final_answer = self.answer_prettify(question_type answers)
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\
     文件       20300  2018-12-15 05:07  QASystemOnMedicalKG-master\README.md
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\__pycache__\
     文件        6207  2018-12-15 05:07  QASystemOnMedicalKG-master\__pycache__\answer_search.cpython-36.pyc
     文件        8462  2018-12-15 05:07  QASystemOnMedicalKG-master\__pycache__\question_classifier.cpython-36.pyc
     文件        7241  2018-12-15 05:07  QASystemOnMedicalKG-master\__pycache__\question_parser.cpython-36.pyc
     文件        6407  2018-12-15 05:07  QASystemOnMedicalKG-master\answer_search.py
     文件       11448  2018-12-15 05:07  QASystemOnMedicalKG-master\build_medicalgraph.py
     文件        1148  2018-12-15 05:07  QASystemOnMedicalKG-master\chatbot_graph.py
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\data\
     文件    47138917  2018-12-15 05:07  QASystemOnMedicalKG-master\data\medical.json
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\
     文件       71654  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\check.txt
     文件         265  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\deny.txt
     文件         593  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\department.txt
     文件      177532  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\disease.txt
     文件       74645  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\drug.txt
     文件       75048  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\food.txt
     文件      507738  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\producer.txt
     文件       99565  2018-12-15 05:07  QASystemOnMedicalKG-master\dict\symptom.txt
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\document\
     文件      576113  2018-12-15 05:07  QASystemOnMedicalKG-master\document\chat1.png
     文件      566775  2018-12-15 05:07  QASystemOnMedicalKG-master\document\chat2.png
     文件      172820  2018-12-15 05:07  QASystemOnMedicalKG-master\document\kg_route.png
     文件      158176  2018-12-15 05:07  QASystemOnMedicalKG-master\document\qa_route.png
     文件       36690  2018-12-15 05:07  QASystemOnMedicalKG-master\document\刘焕勇-20181004-kg_route.pptx
     目录           0  2018-12-15 05:07  QASystemOnMedicalKG-master\img\
     文件      576113  2018-12-15 05:07  QASystemOnMedicalKG-master\img\chat1.png
     文件      566775  2018-12-15 05:07  QASystemOnMedicalKG-master\img\chat2.png
     文件      364359  2018-12-15 05:07  QASystemOnMedicalKG-master\img\graph_summary.png
     文件      172820  2018-12-15 05:07  QASystemOnMedicalKG-master\img\kg_route.png
............此处省略7个文件信息

评论

共有 条评论