• 大小: 5.68MB
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2023-11-18
  • 语言: Python
  • 标签:

资源简介

基于知识图谱的《红楼梦》人物关系可视化及问答系统

资源截图

代码片段和文件信息

from flask import Flask render_template request jsonify
from neo_db.query_graph import queryget_KGQA_answerget_answer_profile
from KGQA.ltp import get_target_array
app = Flask(__name__)


@app.route(‘/‘ methods=[‘GET‘ ‘POST‘])
@app.route(‘/index‘ methods=[‘GET‘ ‘POST‘])

def index(name=None):
    return render_template(‘index.html‘ name = name)


@app.route(‘/search‘ methods=[‘GET‘ ‘POST‘])
def search():
    return render_template(‘search.html‘)


@app.route(‘/KGQA‘ methods=[‘GET‘ ‘POST‘])
def KGQA():
    return render_template(‘KGQA.html‘)
@app.route(‘/get_profile‘methods=[‘GET‘‘POST‘])
def get_profile():
    name = request.args.get(‘character_name‘)
    json_data = get_answer_profile(name)
    return jsonify(json_data)

@app.route(‘/KGQA_answer‘ methods=[‘GET‘ ‘POST‘])
def KGQA_answer():
    question = request.args.get(‘name‘)
    json_data = get_KGQA_answer(get_target_array(str(question)))
    return jsonify(json_data)
@app.route(‘/search_name‘ methods=[‘GET‘ ‘POST‘])
def search_name():
    name = request.args.get(‘name‘)
    json_data=query(str(name))
    return jsonify(json_data)

@app.route(‘/get_all_relation‘ methods=[‘GET‘ ‘POST‘])
def get_all_relation():
    return render_template(‘all_relation.html‘)

if __name__ == ‘__main__‘:
    app.debug=True
    app.run()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-23 13:24  KGQA_HLM-master\
     文件      475014  2019-04-23 13:24  KGQA_HLM-master\1.png
     文件       52229  2019-04-23 13:24  KGQA_HLM-master\2.png
     文件      121444  2019-04-23 13:24  KGQA_HLM-master\3.png
     文件      177332  2019-04-23 13:24  KGQA_HLM-master\4.png
     文件      132484  2019-04-23 13:24  KGQA_HLM-master\5.png
     文件       79898  2019-04-23 13:24  KGQA_HLM-master\6.png
     目录           0  2019-04-23 13:24  KGQA_HLM-master\KGQA\
     目录           0  2019-04-23 13:24  KGQA_HLM-master\KGQA\__pycache__\
     文件        1169  2019-04-23 13:24  KGQA_HLM-master\KGQA\__pycache__\ltp.cpython-36.pyc
     文件        1183  2019-04-23 13:24  KGQA_HLM-master\KGQA\ltp.py
     文件        2860  2019-04-23 13:24  KGQA_HLM-master\README.md
     文件        1313  2019-04-23 13:24  KGQA_HLM-master\app.py
     目录           0  2019-04-23 13:24  KGQA_HLM-master\neo_db\
     目录           0  2019-04-23 13:24  KGQA_HLM-master\neo_db\__pycache__\
     文件        1166  2019-04-23 13:24  KGQA_HLM-master\neo_db\__pycache__\config.cpython-36.pyc
     文件        2347  2019-04-23 13:24  KGQA_HLM-master\neo_db\__pycache__\query_graph.cpython-36.pyc
     文件         971  2019-04-23 13:24  KGQA_HLM-master\neo_db\config.py
     文件         683  2019-04-23 13:24  KGQA_HLM-master\neo_db\creat_graph.py
     文件        2526  2019-04-23 13:24  KGQA_HLM-master\neo_db\query_graph.py
     目录           0  2019-04-23 13:24  KGQA_HLM-master\raw_data\
     文件        9424  2019-04-23 13:24  KGQA_HLM-master\raw_data\relation.txt
     文件          23  2019-04-23 13:24  KGQA_HLM-master\requirement.txt
     目录           0  2019-04-23 13:24  KGQA_HLM-master\spider\
     文件       12292  2019-04-23 13:24  KGQA_HLM-master\spider\.DS_Store
     目录           0  2019-04-23 13:24  KGQA_HLM-master\spider\__pycache__\
     文件         503  2019-04-23 13:24  KGQA_HLM-master\spider\__pycache__\get_character_array.cpython-36.pyc
     文件         595  2019-04-23 13:24  KGQA_HLM-master\spider\__pycache__\show_profile.cpython-36.pyc
     文件         264  2019-04-23 13:24  KGQA_HLM-master\spider\get_character_array.py
     文件        1609  2019-04-23 13:24  KGQA_HLM-master\spider\get_hlm_character.py
     目录           0  2019-04-23 13:24  KGQA_HLM-master\spider\images\
............此处省略232个文件信息

评论

共有 条评论