2 Star 0 Fork 1

Ekko98/KGQA_HLM

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.py 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
chizhu 提交于 2018-05-05 16:30 . 毕设作品
from flask import Flask, render_template, request, jsonify
from neo_db.query_graph import query,get_KGQA_answer,get_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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/ekko98/KGQA_HLM.git
[email protected]:ekko98/KGQA_HLM.git
ekko98
KGQA_HLM
KGQA_HLM
master

搜索帮助