forked from padfoot18/SAHEB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c16b28d
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
__pychache__/* | ||
*.pyc | ||
venv/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from flask import Flask, request | ||
from flask_restful import Resource, Api | ||
from deeppavlov import build_model, configs | ||
from flask_cors import CORS | ||
|
||
|
||
app = Flask(__name__) | ||
CORS(app) | ||
api = Api(app) | ||
|
||
model = None | ||
paragraph = """The application process will remain open at 04th of July to 14th of August. | ||
Application form for admission is available at the Somaiya website. Our hours are 9am-8pm every day. | ||
The fee amount is INR 150000 and the hostel fees is INR 5000. The application fee is the 5000. | ||
There are total 7 courses are available at the university.""" | ||
|
||
|
||
class HelloWorld(Resource): | ||
def get(self): | ||
return {'hello': 'world'} | ||
|
||
|
||
class ChatBot(Resource): | ||
def post(self): | ||
question = request.form['question'] | ||
print(question) | ||
answer = model([paragraph], [question]) | ||
print(answer) | ||
return answer | ||
|
||
|
||
def load_model(): | ||
global model | ||
model = build_model(configs.squad.squad, download=False) | ||
|
||
|
||
api.add_resource(HelloWorld, '/') | ||
api.add_resource(ChatBot, '/chat/') | ||
|
||
|
||
if __name__ == '__main__': | ||
load_model() | ||
app.run(host='127.0.0.1', port=8888, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
absl-py==0.7.0 | ||
aniso8601==4.1.0 | ||
asn1crypto==0.24.0 | ||
astor==0.7.1 | ||
certifi==2018.11.29 | ||
cffi==1.11.5 | ||
chardet==3.0.4 | ||
Click==7.0 | ||
cryptography==2.5 | ||
Cython==0.28.5 | ||
DAWG-Python==0.7.2 | ||
deeppavlov==0.1.6 | ||
docopt==0.6.2 | ||
flasgger==0.9.1 | ||
Flask==1.0.2 | ||
Flask-Cors==3.0.6 | ||
Flask-RESTful==0.3.7 | ||
fuzzywuzzy==0.16.0 | ||
gast==0.2.2 | ||
grpcio==1.18.0 | ||
h5py==2.8.0 | ||
idna==2.7 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.10 | ||
jsonschema==2.6.0 | ||
Keras==2.2.0 | ||
Keras-Applications==1.0.2 | ||
Keras-Preprocessing==1.0.1 | ||
Markdown==3.0.1 | ||
MarkupSafe==1.1.0 | ||
mistune==0.8.4 | ||
nltk==3.2.5 | ||
numpy==1.14.5 | ||
overrides==1.9 | ||
pandas==0.23.1 | ||
protobuf==3.6.1 | ||
pycparser==2.19 | ||
pymorphy2==0.8 | ||
pymorphy2-dicts==2.4.393442.3710985 | ||
pymorphy2-dicts-ru==2.4.404381.4453942 | ||
pyOpenSSL==18.0.0 | ||
pyTelegramBotAPI==3.5.2 | ||
python-dateutil==2.7.5 | ||
pytz==2018.9 | ||
PyYAML==3.13 | ||
requests==2.19.1 | ||
rusenttokenize==0.0.4 | ||
scikit-learn==0.19.1 | ||
scipy==1.1.0 | ||
six==1.12.0 | ||
tensorboard==1.10.0 | ||
tensorflow==1.10.0 | ||
termcolor==1.1.0 | ||
tqdm==4.23.4 | ||
urllib3==1.23 | ||
Werkzeug==0.14.1 |