For English version: README-en
The boilerplate was born as a generic abstraction of the Tais project. Today, it aims to make creating a Rasa chatbot easier. With the evolution of the framework, currently the focus of the boilerplate is live code documentation.
Here you can find a chatbot entirely in Brazilian Portuguese that will help you with examples of dialogue, code and use of Rasa features.
The boilerplate architecture can be divided into 2 main parts:
Process that transforms .yml
configuration files into a modelo treinado
that contains the chatbot's intelligence.
The user interacts with Boilerplate via Telegram, which sends messages to Rasa NLU through connectors, where it identifies the intent , and responds through Rasa Core, according to stories and actions .
The models used for the conversation were generated by the trainer module and then transferred to the bot. These models can be versioned and evolved between bots.
First, clone the repository to your local machine using the command:
git clone https://github.com/lappis-unb/rasa-ptbr-boilerplate.git
To get your Rasa chatbot working, make sure you are in the project folder and then run the following command in the terminal:
make init
This command will build the necessary infrastructure (upload containers with dependencies, train the chatbot and start the chat in shell mode) to enable interaction with the chatbot.
Once everything is installed, you will see the following message and can start interacting with the bot:
Bot loaded. Type a message and press enter (use ' /stop ' to exit):
Your input - >
To close the interaction with the bot, just type ctrl+c
.
make train
make shell
After completing the export tutorial for all necessary environment variables, you can run the bot correctly on Telegram.
Before moving on. Important: Environment variables are necessary for the bot to function correctly, so don't forget to export them.
Then run the bot on Telegram:
make telegram
To visualize the interaction data between the user and the chatbot, we use a part of the Elastic Stack, composed of ElasticSearch and Kibana. Therefore, we use a broker to manage messages. So we were able to add messages to ElasticSearch regardless of the type of messenger we are using.
make build-analytics
Wait until the ElasticSearch services are ready, and run the command below to configure the indexes:
make config-elastic
Wait until the Kibana services are ready, and run the command below to configure the dashboards :
make config-kibana
The above command only needs to be executed once and it will leave the entire analytics
infrastructure ready for use.
Access kibana at the url locahost:5601
If you want to understand the analytics stack configuration process, see the full analytics explanation.
Rasa allows you to add custom modules to your processing pipeline, learn more HERE.
There is an example of a custom component here that implements Sentiment Analysis.
To use it, simply introduce the components.sentiment_analyzer.SentimentAnalyzer
component to the bot/config.yml
file. As in the example:
language : "pt"
pipeline:
- name: WhitespaceTokenizer
- name: "components.sentiment_analyzer.SentimentAnalyzer" - name: RegexFeaturizer
Then, as in the bot/components/labels.yml
file example, add phrases that correspond to a label (rating or sentiment).
Finally, just train the bot again, and the information will be stored in the sentiment
entity if the component identifies a value for that entity.
Lift the notebooks
container
make notebooks
Access the notebook at localhost:8888
Project documentation can be run locally using GitBook. To install gitbook via npm, you need to have Node.js and npm installed on your computer.
npm install -g gitbook gitbook-cli
gitbook build .
gitbook serve .
http://localhost:4000/
Contribution : To contribute to the project documentation read how to contribute to the documentation
Part of the Tais framework's technical documentation is available on the repository's wiki. If you can't find your answer, open an issue with the duvida
tag and we will try to respond as quickly as possible.
If you have any questions regarding Rasa, see the Rasa Stack Brasil Telegram group, we are also there to help.
See more contact information on our website: https://lappis.rocks.
The entire boilerplate framework is developed under the GPL3 license
See the list of license dependencies here