Skip to content

Commit ea40a12

Browse files
Merge pull request #4346 from ovh/vv/vitcheff/chatbot
EN - Add - pages/platform/ai/notebook_tuto_10_create_chatbot
2 parents a864d09 + eb83665 commit ea40a12

17 files changed

+1893
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: AI Notebooks - Tutorial - Create and train a Rasa chatbot
3+
slug: notebooks/create-rasa-chatbot
4+
excerpt: Understand how to create and train a chatbot with AI Notebooks
5+
section: AI Notebooks - Tutorials
6+
order: 10
7+
updated: 2023-03-20
8+
routes:
9+
canonical: 'https://docs.ovh.com/gb/en/publiccloud/ai/notebooks/create-rasa-chatbot/'
10+
---
11+
12+
**Last updated 20th March, 2023.**
13+
14+
## Objective
15+
16+
The aim of the tutorial is to understand how to create and train a chatbot model with AI Notebooks. We will create and train the chatbot with a Visual Studio Code notebook. At the end of the tutorial, we will have a model and we can speak to our chatbot. There is an another tutorial with which you can train your chatbot with the tool `AI Training`: [How to train a chatbot with AI Training](https://docs.ovh.com/de/publiccloud/ai/training/train-rasa-chatbot/).
17+
18+
We will use the famous open source framework [Rasa](https://rasa.community/) to build the chatbot.
19+
20+
## Requirements
21+
22+
- Access to the [OVHcloud Control Panel](https://www.ovh.com/auth/?action=gotomanager&from=https://www.ovh.de/&ovhSubsidiary=de)
23+
- A Public Cloud project created
24+
- The ovhai CLI interface installed on your system (more information [here](https://docs.ovh.com/de/publiccloud/ai/cli/install-client/))
25+
- A [user for AI Notebooks](https://docs.ovh.com/de/publiccloud/ai/users/)
26+
27+
## Instructions
28+
29+
### Create a token to access your AI services
30+
31+
The first step is to create an AI applicative token. With this token, you will be able to securely access all of your AI services.
32+
33+
To do this, launch this command on the terminal once the ovhai CLI is installed:
34+
35+
``` bash
36+
ovhai token create -l model=rasabotRW --role operator token-RW-chatbot
37+
```
38+
39+
Here is the reference to install the CLI: [CLI Installation](https://docs.ovh.com/de/publiccloud/ai/cli/install-client/).
40+
41+
The token is now created. Don't forget to save the token to use it later.
42+
43+
Now, if you already have trained some Rasa models with AI Training by following [our tutorial](https://docs.ovh.com/de/publiccloud/ai/training/train-rasa-chatbot/), you already have created a container with your trained models. You can skip the next part and go directly [here](#visualstudiocode).
44+
45+
### Understand storage concepts
46+
47+
The obvious goal about using object storage and not the local storage of the AI Notebook is to decorrelate compute and storage, allowing us to stop or delete the notebook while keeping the data safe.
48+
49+
If you want to know more about data storage concept, read this guide: [Create an object container](https://docs.ovh.com/de/storage/object-storage/pcs/create-container/).
50+
51+
For the chatbot, we will create one object storage bucket. This bucket will be filled over time by our trained model output. The container in which the model will be saved does not need to be created. When we will launch our notebook, the container will be automatically created.
52+
53+
Now, let's start to create and train our chatbot.
54+
55+
### Create and train a chatbot with a Visual Studio Code notebook <a name="visualstudiocode"></a>
56+
57+
In order to do it you will need to create a Visual Studio Code notebook. You can attach one volume if you want to save the model created.
58+
59+
Don't forget to put the model inside the folder `trained-models` before stopping your notebook. By doing this, your model will be saved in your object container even if you delete your notebook. Here is the command to run:
60+
61+
62+
``` console
63+
ovhai notebook run conda vscode \
64+
--name vscode-ovh-chatbot \
65+
--framework-version conda-py39-cuda11.2-v22-4 \
66+
--volume <model-output-container>@GRA:/workspace/trained-models:RW \
67+
--cpu 10 \
68+
--token <token> \
69+
--label model=rasabotRO \
70+
-s ~/.ssh/id_rsa.pub
71+
```
72+
73+
Explanation of each line:
74+
75+
- Launch a notebook with the Python Miniconda framework in a Visual Studio Code editor.
76+
- Name it "vscode-ovh-chatbot".
77+
- Specify a version for the conda framework (Python 3.9).
78+
- Attach 1 data volume to the notebook, as explained previously.
79+
- Request 10 CPUs. The more we add, the more performant it is.
80+
- Add the token previously created.
81+
- Label this notebook "rasabotRO".
82+
- Optional: The last line is the path to your ssh key on your machine. It is important to set up the key here to connect remotely from VScode. If you don't want to, you can connect directly on the web with the token you created before.
83+
84+
> [!primary]
85+
>
86+
> Note that the **GitHub** repository does not have to be added because it is already present when you create an AI Notebook.
87+
>
88+
89+
Your notebook is ready, you can access it and log in.
90+
91+
Before training an AI model inside the notebook, you must install all the dependencies of Rasa. Open a terminal and launch this command:
92+
93+
```console
94+
pip install rasa
95+
```
96+
97+
Once you have installed all the dependencies, you can create and train the chatbot with only one command in your terminal. Run it at the root of your directory:
98+
99+
```console
100+
rasa init
101+
```
102+
103+
It will create some folders with basic data for the Rasa chatbot. During the command, you can also train a model and speak with the chatbot at the end. Here is a small example of a conversation with the chatbot.
104+
105+
![image](images/conversation.png){.thumbnail}
106+
107+
Here, we train a very simple model with few data. There are some frameworks like [Chatette](https://github.com/SimGus/Chatette) that generate some data and permit to create more powerful models.
108+
109+
## Go further
110+
111+
If you want to use more functionalities of Rasa, please follow this link. We use Rasa Open Source and not Rasa X.
112+
113+
[Rasa Open source](https://rasa.com/docs/rasa/)
114+
115+
If you want to deploy your created model with the chatbot, you can follow this tutorial:
116+
117+
[How to deploy a chatbot](https://docs.ovh.com/de/publiccloud/ai/deploy/deploy-rasa-chatbot)
118+
119+
If you want to train a Rasa chatbot with the tool AI Training, please refer to this tutorial:
120+
121+
[How to train a chatbot with docker and AI Training](https://docs.ovh.com/de/publiccloud/ai/training/train-rasa-chatbot/)
122+
123+
## Feedback
124+
125+
Please send us your questions, feedback and suggestions to improve the service:
126+
127+
- On the OVHcloud [Discord server](https://discord.com/invite/vXVurFfwe9)
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: AI Notebooks - Tutorial - Create and train a Rasa chatbot
3+
slug: notebooks/create-rasa-chatbot
4+
excerpt: Understand how to create and train a chatbot with AI Notebooks
5+
section: AI Notebooks - Tutorials
6+
order: 10
7+
updated: 2023-03-20
8+
---
9+
10+
**Last updated 20th March, 2023.**
11+
12+
## Objective
13+
14+
The aim of the tutorial is to understand how to create and train a chatbot model with AI Notebooks. We will create and train the chatbot with a Visual Studio Code notebook. At the end of the tutorial, we will have a model and we can speak to our chatbot. There is an another tutorial with which you can train your chatbot with the tool `AI Training`: [How to train a chatbot with AI Training](https://docs.ovh.com/asia/en/publiccloud/ai/training/train-rasa-chatbot/).
15+
16+
We will use the famous open source framework [Rasa](https://rasa.community/) to build the chatbot.
17+
18+
## Requirements
19+
20+
- Access to the [OVHcloud Control Panel](https://ca.ovh.com/auth/?action=gotomanager&from=https://www.ovh.com/asia/&ovhSubsidiary=asia)
21+
- A Public Cloud project created
22+
- The ovhai CLI interface installed on your system (more information [here](https://docs.ovh.com/asia/en/publiccloud/ai/cli/install-client/))
23+
- A [user for AI Notebooks](https://docs.ovh.com/asia/en/publiccloud/ai/users/)
24+
25+
## Instructions
26+
27+
### Create a token to access your AI services
28+
29+
The first step is to create an AI applicative token. With this token, you will be able to securely access all of your AI services.
30+
31+
To do this, launch this command on the terminal once the ovhai CLI is installed:
32+
33+
``` bash
34+
ovhai token create -l model=rasabotRW --role operator token-RW-chatbot
35+
```
36+
37+
Here is the reference to install the CLI: [CLI Installation](https://docs.ovh.com/asia/en/publiccloud/ai/cli/install-client/).
38+
39+
The token is now created. Don't forget to save the token to use it later.
40+
41+
Now, if you already have trained some Rasa models with AI Training by following [our tutorial](https://docs.ovh.com/asia/en/publiccloud/ai/training/train-rasa-chatbot/), you already have created a container with your trained models. You can skip the next part and go directly [here](#visualstudiocode).
42+
43+
### Understand storage concepts
44+
45+
The obvious goal about using object storage and not the local storage of the AI Notebook is to decorrelate compute and storage, allowing us to stop or delete the notebook while keeping the data safe.
46+
47+
If you want to know more about data storage concept, read this guide: [Create an object container](https://docs.ovh.com/asia/en/storage/object-storage/pcs/create-container/).
48+
49+
For the chatbot, we will create one object storage bucket. This bucket will be filled over time by our trained model output. The container in which the model will be saved does not need to be created. When we will launch our notebook, the container will be automatically created.
50+
51+
Now, let's start to create and train our chatbot.
52+
53+
### Create and train a chatbot with a Visual Studio Code notebook <a name="visualstudiocode"></a>
54+
55+
In order to do it you will need to create a Visual Studio Code notebook. You can attach one volume if you want to save the model created.
56+
57+
Don't forget to put the model inside the folder `trained-models` before stopping your notebook. By doing this, your model will be saved in your object container even if you delete your notebook. Here is the command to run:
58+
59+
60+
``` console
61+
ovhai notebook run conda vscode \
62+
--name vscode-ovh-chatbot \
63+
--framework-version conda-py39-cuda11.2-v22-4 \
64+
--volume <model-output-container>@GRA:/workspace/trained-models:RW \
65+
--cpu 10 \
66+
--token <token> \
67+
--label model=rasabotRO \
68+
-s ~/.ssh/id_rsa.pub
69+
```
70+
71+
Explanation of each line:
72+
73+
- Launch a notebook with the Python Miniconda framework in a Visual Studio Code editor.
74+
- Name it "vscode-ovh-chatbot".
75+
- Specify a version for the conda framework (Python 3.9).
76+
- Attach 1 data volume to the notebook, as explained previously.
77+
- Request 10 CPUs. The more we add, the more performant it is.
78+
- Add the token previously created.
79+
- Label this notebook "rasabotRO".
80+
- Optional: The last line is the path to your ssh key on your machine. It is important to set up the key here to connect remotely from VScode. If you don't want to, you can connect directly on the web with the token you created before.
81+
82+
> [!primary]
83+
>
84+
> Note that the **GitHub** repository does not have to be added because it is already present when you create an AI Notebook.
85+
>
86+
87+
Your notebook is ready, you can access it and log in.
88+
89+
Before training an AI model inside the notebook, you must install all the dependencies of Rasa. Open a terminal and launch this command:
90+
91+
```console
92+
pip install rasa
93+
```
94+
95+
Once you have installed all the dependencies, you can create and train the chatbot with only one command in your terminal. Run it at the root of your directory:
96+
97+
```console
98+
rasa init
99+
```
100+
101+
It will create some folders with basic data for the Rasa chatbot. During the command, you can also train a model and speak with the chatbot at the end. Here is a small example of a conversation with the chatbot.
102+
103+
![image](images/conversation.png){.thumbnail}
104+
105+
Here, we train a very simple model with few data. There are some frameworks like [Chatette](https://github.com/SimGus/Chatette) that generate some data and permit to create more powerful models.
106+
107+
## Go further
108+
109+
If you want to use more functionalities of Rasa, please follow this link. We use Rasa Open Source and not Rasa X.
110+
111+
[Rasa Open source](https://rasa.com/docs/rasa/)
112+
113+
If you want to deploy your created model with the chatbot, you can follow this tutorial:
114+
115+
[How to deploy a chatbot](https://docs.ovh.com/asia/en/publiccloud/ai/deploy/deploy-rasa-chatbot)
116+
117+
If you want to train a Rasa chatbot with the tool AI Training, please refer to this tutorial:
118+
119+
[How to train a chatbot with docker and AI Training](https://docs.ovh.com/asia/en/publiccloud/ai/training/train-rasa-chatbot/)
120+
121+
## Feedback
122+
123+
Please send us your questions, feedback and suggestions to improve the service:
124+
125+
- On the OVHcloud [Discord server](https://discord.com/invite/vXVurFfwe9)
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: AI Notebooks - Tutorial - Create and train a Rasa chatbot
3+
slug: notebooks/create-rasa-chatbot
4+
excerpt: Understand how to create and train a chatbot with AI Notebooks
5+
section: AI Notebooks - Tutorials
6+
order: 10
7+
updated: 2023-03-20
8+
---
9+
10+
**Last updated 20th March, 2023.**
11+
12+
## Objective
13+
14+
The aim of the tutorial is to understand how to create and train a chatbot model with AI Notebooks. We will create and train the chatbot with a Visual Studio Code notebook. At the end of the tutorial, we will have a model and we can speak to our chatbot. There is an another tutorial with which you can train your chatbot with the tool `AI Training`: [How to train a chatbot with AI Training](https://docs.ovh.com/au/en/publiccloud/ai/training/train-rasa-chatbot/).
15+
16+
We will use the famous open source framework [Rasa](https://rasa.community/) to build the chatbot.
17+
18+
## Requirements
19+
20+
- Access to the [OVHcloud Control Panel](https://ca.ovh.com/auth/?action=gotomanager&from=https://www.ovh.com.au/&ovhSubsidiary=au)
21+
- A Public Cloud project created
22+
- The ovhai CLI interface installed on your system (more information [here](https://docs.ovh.com/au/en/publiccloud/ai/cli/install-client/))
23+
- A [user for AI Notebooks](https://docs.ovh.com/au/en/publiccloud/ai/users/)
24+
25+
## Instructions
26+
27+
### Create a token to access your AI services
28+
29+
The first step is to create an AI applicative token. With this token, you will be able to securely access all of your AI services.
30+
31+
To do this, launch this command on the terminal once the ovhai CLI is installed:
32+
33+
``` bash
34+
ovhai token create -l model=rasabotRW --role operator token-RW-chatbot
35+
```
36+
37+
Here is the reference to install the CLI: [CLI Installation](https://docs.ovh.com/au/en/publiccloud/ai/cli/install-client/).
38+
39+
The token is now created. Don't forget to save the token to use it later.
40+
41+
Now, if you already have trained some Rasa models with AI Training by following [our tutorial](https://docs.ovh.com/au/en/publiccloud/ai/training/train-rasa-chatbot/), you already have created a container with your trained models. You can skip the next part and go directly [here](#visualstudiocode).
42+
43+
### Understand storage concepts
44+
45+
The obvious goal about using object storage and not the local storage of the AI Notebook is to decorrelate compute and storage, allowing us to stop or delete the notebook while keeping the data safe.
46+
47+
If you want to know more about data storage concept, read this guide: [Create an object container](https://docs.ovh.com/au/en/storage/object-storage/pcs/create-container/).
48+
49+
For the chatbot, we will create one object storage bucket. This bucket will be filled over time by our trained model output. The container in which the model will be saved does not need to be created. When we will launch our notebook, the container will be automatically created.
50+
51+
Now, let's start to create and train our chatbot.
52+
53+
### Create and train a chatbot with a Visual Studio Code notebook <a name="visualstudiocode"></a>
54+
55+
In order to do it you will need to create a Visual Studio Code notebook. You can attach one volume if you want to save the model created.
56+
57+
Don't forget to put the model inside the folder `trained-models` before stopping your notebook. By doing this, your model will be saved in your object container even if you delete your notebook. Here is the command to run:
58+
59+
60+
``` console
61+
ovhai notebook run conda vscode \
62+
--name vscode-ovh-chatbot \
63+
--framework-version conda-py39-cuda11.2-v22-4 \
64+
--volume <model-output-container>@GRA:/workspace/trained-models:RW \
65+
--cpu 10 \
66+
--token <token> \
67+
--label model=rasabotRO \
68+
-s ~/.ssh/id_rsa.pub
69+
```
70+
71+
Explanation of each line:
72+
73+
- Launch a notebook with the Python Miniconda framework in a Visual Studio Code editor.
74+
- Name it "vscode-ovh-chatbot".
75+
- Specify a version for the conda framework (Python 3.9).
76+
- Attach 1 data volume to the notebook, as explained previously.
77+
- Request 10 CPUs. The more we add, the more performant it is.
78+
- Add the token previously created.
79+
- Label this notebook "rasabotRO".
80+
- Optional: The last line is the path to your ssh key on your machine. It is important to set up the key here to connect remotely from VScode. If you don't want to, you can connect directly on the web with the token you created before.
81+
82+
> [!primary]
83+
>
84+
> Note that the **GitHub** repository does not have to be added because it is already present when you create an AI Notebook.
85+
>
86+
87+
Your notebook is ready, you can access it and log in.
88+
89+
Before training an AI model inside the notebook, you must install all the dependencies of Rasa. Open a terminal and launch this command:
90+
91+
```console
92+
pip install rasa
93+
```
94+
95+
Once you have installed all the dependencies, you can create and train the chatbot with only one command in your terminal. Run it at the root of your directory:
96+
97+
```console
98+
rasa init
99+
```
100+
101+
It will create some folders with basic data for the Rasa chatbot. During the command, you can also train a model and speak with the chatbot at the end. Here is a small example of a conversation with the chatbot.
102+
103+
![image](images/conversation.png){.thumbnail}
104+
105+
Here, we train a very simple model with few data. There are some frameworks like [Chatette](https://github.com/SimGus/Chatette) that generate some data and permit to create more powerful models.
106+
107+
## Go further
108+
109+
If you want to use more functionalities of Rasa, please follow this link. We use Rasa Open Source and not Rasa X.
110+
111+
[Rasa Open source](https://rasa.com/docs/rasa/)
112+
113+
If you want to deploy your created model with the chatbot, you can follow this tutorial:
114+
115+
[How to deploy a chatbot](https://docs.ovh.com/au/en/publiccloud/ai/deploy/deploy-rasa-chatbot)
116+
117+
If you want to train a Rasa chatbot with the tool AI Training, please refer to this tutorial:
118+
119+
[How to train a chatbot with docker and AI Training](https://docs.ovh.com/au/en/publiccloud/ai/training/train-rasa-chatbot/)
120+
121+
## Feedback
122+
123+
Please send us your questions, feedback and suggestions to improve the service:
124+
125+
- On the OVHcloud [Discord server](https://discord.com/invite/vXVurFfwe9)

0 commit comments

Comments
 (0)