Chatbot app in Flask scheduled with Airflow

Monika Łukowska
Senior Data Scientist
Automatic Summary

Stages of the Presentation on Chatbot in Digitalization

Whether you're new to the realm of chatbots or an old hand, this presentation covers every element from the role of chatbot in the grand scheme of digitalization, conversation analysis, to reporting with Afro Aporo. Furthermore, we'll dive into the development of a chatbot script using Rasa and Flask, and end with an analysis.

The Role of Chatbots in Digital Transformation

Chatbots, also known as virtual assistants, can interpret and respond to users using their natural language and even have their personality closely aligned with the company's ethos. These qualities can enhance user experience by making interactions user-friendly, simplified, and above all, immediately beneficial. This ultimately helps in expanding your audience reach and positively impacting customer behaviors.

Benefits of Chatbots in Digital Transformation

Beyond providing a superior user experience, chatbots play a vital part in digital marketing due to their data-focused capabilities. By collecting, analyzing, and processing data, chatbots can create highly accurate predictive models of their users’ preferred behaviors. They also help in executing intricate market research based on user preferences and suggestions. Another plus is the invaluable analytical benefits from the analysis of failed products or services, specific request data, and customer satisfaction metrics.

APA Aflow: Collecting Statistics and Analytics

APA Aflow is an essential tool used to collect statistics and analytics. It manages various tasks, workflows in a project, and defines the execution by using code, thereby facilitating information collection about customers, sending this data to the chatbot, and collecting data on customer complaints for analysis and reports.

Rasa Framework: Building Chatbots

In this chatbot project, Rasa framework is employed, which offers a simple approach to creating chatbots using trained language models with minimum training data. It's an open-source tool comprised of two frameworks: Rasa Ana and Rasa Core.

  • Rasa Ana: It is the interpreter that comprehends the input. It is the backbone of our chatbot's understanding of natural language, categorizing intents, and extracting entities.
  • Rasa Core: It is the second framework that does all the remaining work, including conversation flow, which is of prime importance. For instance, when a positive feeling is expressed to the bot, the Rasa Core deciphers and responds with a positive feeling as well.

Visual Studio Code: The Chatbot's Code

The Chatbot project's code resides in Visual Studio, including the Flask application, Rasa engine, and the chatbot's action training, training set, and stories.

Episode by episode, you will also explore more about intent and entity extraction, intent classification, and managing conversations when people challenge the chatbot.

Additional Resources

All project files are freely available on GitHub for further learning and experimentation.


Chatbots are not just tools of convenience; they have become an integral part of enhancing customer experiences and boosting digital transformation. To build them effectively requires a deep understanding of data, natural language processing, and user behavior. Successful implementation of chatbots can lead not only to improved user experiences but also increased market reach and significant analytical benefits.

Indeed, the journey of chatbot creation is undeniably intricate but equally intriguing. Embrace the challenge, harness the knowledge, and you'll soon find yourself a pro at the chatbot game!

Video Transcription

Uh Here is a description of the stages uh that are planned for the presentation. Uh First, I will talk about the role of chatbot in digitalization. And uh next, uh I will talk about conversation analysis and uh automatic of conversation statistical reporting.Uh It will be in Afro uh Afro Aporo. And uh next I show the script uh of the chatbot uh produces in Rasa and flags. And uh finally, I show uh analysis, music Afro. And uh now uh I will talk about chatbot in uh digital transformation and the chatbot knows as virtual assistant uh and can interpret that and response to use users natural language and have a personality of their own that is closely uh like to uh the of company. Mm These features make uh the user experience friendly, simple, but above uh all that is uh the provo provote useful so useful uh solution instantly. Uh the chatbot uh help increase your audience uh by interna internet interaction and increase customer behaviors and the benefits.

Uh And uh next uh next uh in this part, I would like uh to describe the benefit and fact uh that make chatbot an important part of digital transformation. And uh they are particularly important in digital marketing by collecting, analyzing and uh processing data. Uh chatbot make a very accurate predictive models on the consumption uh preference of their customers. And the top bot help uh in complex market research on use uh on user uh preference or suggestion. Mm And the analytical uh benefits um of childbirth are uh analysis of uh of uh failed products and service, uh service specific specific request and the customer satisfaction. And um and uh now I would uh I will talk about APA aflow uh was used to collect statistic uh and analytics uh aflow uh schedule and multiple uh multiple tasks, workflows in project. And we uh and define the uh execution using code um mm in uh in this project uh AFL get information about customers uh and sending this information to the uh chatbot in and G and collecting information about customer complaint for analysis and daily report. And uh the most important uh in APA EFL is uh D A. This is a direct a cycling graph.

And uh this is a set of tasks that when combined combined create uh and create a flow in that uh we can specify the relationship between operators order and depends dependence and the operator represent a single task. And the task is uh um instance of specific operator run in the dark representation. Mhm And in uh the uh in uh Rasa uh uh Uh So uh in my uh my chatbot, I use uh Rasa framework and uh which is a framework for putting chatbot uh in simple way using trained uh trained model language models uh with a small amount of training data. And this is open source uh tools. And um this is uh it, it has uh two frameworks uh another and car mm and the A L uh Rasa Ana Law, the framework analog uh is the interpreters which uh understand the input uh is the framework uh to natural language, understanding uh with intent, classification and entity extraction.

And the L A core is the second framework. Uh those uh the rest of the work uh You want your God to do uh the flow of conversation is the most important thing. And for the example, uh may, when I say uh I like you to the Bo the Rasa and the law will understand the input intent uh as a positive feeling and Rasa occur. I will tell you uh we tell uh the boat to repeat with uh I like you to from the category of positive intentions. And the uh reply back will be a positive feeling. Uh if uh my drain uh your boat uh for it or it might do uh might be anything else as well. And I will show you more in the uh example in the my code. Uh So, so next I show a visual studio code. Mm um Ok. Mhm. Mhm. Mhm. Ok. So I will share this code uh ok. Uh this is the product Chatbot. Mm in uh uh uh this direction uh is there is Flask uh Flask application. Uh there is Rasa engine and uh this is action training, uh training set and stories for the RSA uh uh for the Chatbot.

Uh there is models and here we sh we, we see uh the mother uh and alone and uh this place uh is uh configuration for engine uh Rasa is the most important uh the most important uh code for uh for a chatbot with LASA. And we have pipeline uh for ANA O. And next is policies for uh RAAO and uh these policies is for stories in Talbot. And this pipeline is for uh for uh analog where we building uh where we building um intent and entity extraction and this is uh language uh is English for this child. What mm The most important is uh tokenizer uh radix utilize and uh this Fizer vector count and this uh this diet classifier is for uh intent classification. And we see I use docking entity extractor uh for uh for extract entity. And we have entity time number, money and distance for this uh uh for this trans uh this chatbot. And uh second is entity mapper for uh for the series in uh Rasak. OK. So uh we see uh configuration for Chatbot and uh next I show you uh analog. Uh This is training uh set for uh for this chatbot. And uh the first intent is grid and this is example for extract uh grid. Mm This is it and affirm any satisfaction uh dissatisfaction and uh and other uh other intent for this uh distract spot.

And uh the second important is uh rules and the ruler uh is important because uh uh maybe uh is uh maybe uh some people uh um will be challenged uh the boat. And uh this is a reaction for the boat when uh some uh somebody's uh that uh uh I am bought and bought uh get in action. I uh im bot and this is uh this is, that is the message uh from the bot and this message uh is in the uh is in file domain and I show you what the bot answer for uh for somebody. OK. Mhm OK. So uh next is the stories uh file and in the stories we have uh half uh reclamation, return and return set and uh the path uh describe uh conversation when uh when the people would ask uh ask about uh about uh about uh product number and uh the boat uh uh the boat uh say this uh this message.

And uh this message is uh uh is uh important uh uh for the intent reclamation. When the people say uh about reclamation. Next, the vote uh change uh action, reclamation. And this action is in this file in this um in this file, Python. And we see this action. And uh this is uh the most important uh for, for uh the story reclamation path in the uh in the other story uh return, we, we see uh more uh more action and uh intent. OK. So uh this file is the most important for uh create chatbot in uh LASA. And uh the application flask uh is important for uh configuration database uh in this place. And uh this is connection string for uh the database. And we see uh uh this uh this uh post uh is for uh users. And uh we, we see select, we see query for uh for the database with user name and surname uh from this uh this database. And we uh we take uh the client, the customer id and uh the boat now hope uh hope of who is it and the customer and this is uh this is uh so important uh doctor file uh for this uh this chatbot. And I think uh this most important file for uh for create Chatbot.

And uh more uh more information I uh put, put this uh this uh project in uh github and maybe uh want uh can uh no land this file and uh challenge uh and to challenge this project. So uh I go to presentation now and uh this is uh this is finally uh finally slide and uh thank you for, uh, for, uh.