forked from vishakha-lall/MapBot
-
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.
Merge branch 'gssoc-master' into gssoc-master
- Loading branch information
Showing
29 changed files
with
1,334 additions
and
430 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
__pycache__ | ||
.dockerignore | ||
stanford-corenlp-full-2018-10-05/ |
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,24 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'bug' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'enhancement' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,30 @@ | ||
<!-- The title of the PR should be of this format: <Title_of_Issue>_resolved --> | ||
Fixes # <!-- Add the issue number that is fixed by this PR --> | ||
|
||
<!-- Describe the PR as follows --> | ||
## Description: | ||
|
||
- Files changed: | ||
- Dependencies if any: <!-- List the dependencies on other issues/PRs --> | ||
- Basic tests done to validate: | ||
- Conflicts if any: <!-- Describe the reason for conflict --> | ||
|
||
<!-- Use '[x]' to indicate checked box in the list below --> | ||
## Checklist: | ||
|
||
- [ ] All coding conventions are followed | ||
- [ ] Style guidelines for this project have been followed | ||
- [ ] 4 space indentation is used | ||
- [ ] Relevant comments are added | ||
- [ ] The code has been tested | ||
- [ ] No new warnings are generated | ||
|
||
<!-- Add screenshots of locally tested code --> | ||
## Screenshots: | ||
|
||
|
||
<!-- Provide any other information that is relevant to this pull request --> | ||
## Other Information: | ||
|
||
|
||
@ <!-- Tag mentor/project admin to review and merge --> |
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 |
---|---|---|
@@ -1,3 +1,127 @@ | ||
stanford-corenlp-full-2018-10-05/ | ||
__pycache__ | ||
config.py | ||
# Editors | ||
.vscode/ | ||
.idea/ | ||
|
||
# Vagrant | ||
.vagrant/ | ||
|
||
# Mac/OSX | ||
.DS_Store | ||
|
||
# Windows | ||
Thumbs.db | ||
|
||
# Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json |
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,12 @@ | ||
language: python | ||
python: | ||
- "3.6" | ||
cache: pip | ||
install: | ||
- pip install -r requirements.txt | ||
before_script: | ||
- black --check . || true | ||
script: | ||
- flake8 . --count --select=E101,E722,E9,F4,F63,F7,F82,W191 --show-source --statistics | ||
- flake8 . --count --exit-zero --max-line-length=127 --statistics | ||
- pytest |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
FROM python:3.6 | ||
FROM python:3.6-slim-stretch | ||
|
||
RUN apt-get update && apt-get install -y git wget unzip | ||
|
||
COPY requirements.txt ./requirements.txt | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /usr/var/ | ||
WORKDIR /usr/var/ | ||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
|
||
CMD ["python", "./init.py"] | ||
WORKDIR /usr/var/MapBot | ||
ENTRYPOINT ["/bin/sh","/usr/local/bin/docker-entrypoint.sh"] |
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,10 @@ | ||
DB_USER=root | ||
DB_PASSWORD=<YOUR_MYSQL_ROOT_USER_PASSWORD_HERE> | ||
DB_HOST=localhost | ||
DATABASE=mapbot | ||
DB_PORT=3306 | ||
GCLOUD_API_KEY=<YOUR_API_KEY_HERE> | ||
JAVAHOME=<YOUR_JAVAHOME_PATH_HERE> | ||
STANFORD_PATH_TO_JAR=<YOUR_STANFORD_PATH_TO_JAR_HERE> | ||
STANFORD_PATH_TO_MODELS_JAR=<YOUR_STANFORD_PATH_TO_MODELS_JAR_HERE> | ||
TELEGRAM_BOT_TOKEN=<YOUR_API_KEY_HERE> |
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,8 @@ | ||
DB_USER=root | ||
DB_PASSWORD=root | ||
DB_HOST=db | ||
DATABASE=mapbot | ||
DB_PORT=3306 | ||
JAVAHOME=/usr/local/openjdk-11/bin/java | ||
STANFORD_PATH_TO_JAR=./stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2.jar | ||
STANFORD_PATH_TO_MODELS_JAR=./stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2-models.jar |
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
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,19 @@ | ||
from flask import Flask, jsonify | ||
from chatbot import message_to_bot, setup | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route("/chatbot/<user_input>", methods=["GET"]) | ||
def chat(user_input): | ||
try: | ||
response = message_to_bot(user_input, clf, learn_response) | ||
except Exception: | ||
return jsonify({"message": ("Unable to get response", learn_response)}, 500) | ||
|
||
return jsonify({"message": response}, 200) | ||
|
||
|
||
if __name__ == "__main__": | ||
clf, learn_response = setup() | ||
app.run(debug=False) |
Oops, something went wrong.