inishar commited on
Commit
0944479
·
verified ·
1 Parent(s): a75b118

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -48
README.md CHANGED
@@ -1,52 +1,9 @@
1
- # Chatbot Deployment with Flask and JavaScript
2
 
3
- In this tutorial we deploy the chatbot I created in [this](https://github.com/python-engineer/pytorch-chatbot) tutorial with Flask and JavaScript.
4
 
5
- This gives 2 deployment options:
6
- - Deploy within Flask app with jinja2 template
7
- - Serve only the Flask prediction API. The used html and javascript files can be included in any Frontend application (with only a slight modification) and can run completely separate from the Flask App then.
8
 
9
- ## Initial Setup:
10
- This repo currently contains the starter files.
11
 
12
- Clone repo and create a virtual environment
13
- ```
14
- $ git clone https://github.com/python-engineer/chatbot-deployment.git
15
- $ cd chatbot-deployment
16
- $ python3 -m venv venv
17
- $ . venv/bin/activate
18
- ```
19
- Install dependencies
20
- ```
21
- $ (venv) pip install Flask torch torchvision nltk
22
- ```
23
- Install nltk package
24
- ```
25
- $ (venv) python
26
- >>> import nltk
27
- >>> nltk.download('punkt')
28
- ```
29
- Modify `intents.json` with different intents and responses for your Chatbot
30
-
31
- Run
32
- ```
33
- $ (venv) python train.py
34
- ```
35
- This will dump data.pth file. And then run
36
- the following command to test it in the console.
37
- ```
38
- $ (venv) python chat.py
39
- ```
40
-
41
- Now for deployment follow my tutorial to implement `app.py` and `app.js`.
42
-
43
- ## Watch the Tutorial
44
- [![Alt text](https://img.youtube.com/vi/a37BL0stIuM/hqdefault.jpg)](https://youtu.be/a37BL0stIuM)
45
- [https://youtu.be/a37BL0stIuM](https://youtu.be/a37BL0stIuM)
46
-
47
- ## Note
48
- In the video we implement the first approach using jinja2 templates within our Flask app. Only slight modifications are needed to run the frontend separately. I put the final frontend code for a standalone frontend application in the [standalone-frontend](/standalone-frontend) folder.
49
-
50
- ## Credits:
51
- This repo was used for the frontend code:
52
- https://github.com/hitchcliff/front-end-chatjs
 
1
+ 1. Create a virtual environment using python -m venv venv
2
 
3
+ 2. Go to the venv using the command venv\Scripts\activate
4
 
5
+ 3. Install the required packages
 
 
6
 
7
+ 4. Train the model using python train.py
 
8
 
9
+ 5. Use python app.py to check in localhost