new(all): General Bots reading comprehension.
This commit is contained in:
parent
1b14186135
commit
5dbe90023e
1 changed files with 8 additions and 3 deletions
11
app.py
11
app.py
|
|
@ -5,6 +5,8 @@ import os
|
||||||
from allennlp.predictors.predictor import Predictor
|
from allennlp.predictors.predictor import Predictor
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
logging.info('Starting General Bots Models server.')
|
||||||
|
|
||||||
# https://ai.google.com/research/NaturalQuestions
|
# https://ai.google.com/research/NaturalQuestions
|
||||||
|
|
||||||
predictor = None
|
predictor = None
|
||||||
|
|
@ -12,9 +14,12 @@ predictor = None
|
||||||
from flask import Flask, render_template, request
|
from flask import Flask, render_template, request
|
||||||
import hmac
|
import hmac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route("/query", methods=['POST'])
|
|
||||||
|
@app.route("/reading-comprehension", methods=['POST'])
|
||||||
def index():
|
def index():
|
||||||
logging.info('General Bots QA.')
|
logging.info('General Bots QA.')
|
||||||
|
|
||||||
|
|
@ -40,6 +45,6 @@ def index():
|
||||||
else:
|
else:
|
||||||
return "No answers for this question."
|
return "No answers for this question."
|
||||||
|
|
||||||
if __name__ == '__main__':
|
app.run(debug=True)
|
||||||
app.run(debug=True)
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue