0% found this document useful (0 votes)
77 views15 pages

FitAI: Intelligent Yoga Chatbot

The document describes the development of a chatbot called FitAI that will intelligently recommend yoga poses and routines to users based on their fitness goals and health status. It discusses how the Rasa framework was used to build the chatbot's natural language understanding and dialogue management capabilities by training on example conversations and stories. The chatbot is intended to help streamline the fitness industry by automating some customer support tasks and prescriptions that are currently provided by human yoga teachers and trainers.

Uploaded by

Raiden
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views15 pages

FitAI: Intelligent Yoga Chatbot

The document describes the development of a chatbot called FitAI that will intelligently recommend yoga poses and routines to users based on their fitness goals and health status. It discusses how the Rasa framework was used to build the chatbot's natural language understanding and dialogue management capabilities by training on example conversations and stories. The chatbot is intended to help streamline the fitness industry by automating some customer support tasks and prescriptions that are currently provided by human yoga teachers and trainers.

Uploaded by

Raiden
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

FITAI CHATBOT

AN INTELLIGENT DIALOGUE SYSTEM


MOTIVATION?

Chatbots have become increasingly popular in past few


years and are being used in each and every industry, which
uses any digital platform. Be it food, medical, service
industry et al, chat bots have helped organizations to
streamline their workforce.
As a popular adage goes “Health is Wealth”. Our chatbot is
a small effort in that direction. We have attempted to
create a bot which will be able to answer users’ queries
about ‘yogasnanas’ based on one’s goal. The bot is
intelligent enough to gauge user’s present health status and
prescribe yoga workouts which will be beneficial and not
cause any adverse impact.
FitAI bot should make the fitness care easier. It should
facilitate the first contact by collecting relevant
information and follow-up after fitness sessions, schedule
future appointments and prescribe dietary
recommendations.

1|PAGE
BUSINESS BENEFITS?

Primarily the FitAI bot intends to eliminate/transform the L1


support of our sponsors (aka [Link]). Since there are a
limited number of workouts which could be performed, hence
by automating the prescription process to the users we would
help eliminate the extra cost for our sponsors. Below are a few
benefits which our sponsor could reap by deploying out chat
bot:
1. Cost saving
2. Re-alignment of resources to more productive aspects of
business
3. Re-use/Re-train the model to serve other similar tasks
4. Will avoid user queues waiting for their turn, which in
turn results in higher CSAT
5. An accurate bot will enhance the prestige of the
company.

2|PAGE
PROJECT DESCRIPTION: BIRD’S EYE
VIEW

The FitAi Bot is an Artificial & Intelligent Conversational


fitness Agent which guides the trainee to stay fit. It is able to
suggest different “Yogasanas” to user based on his/her fitness
goal. The Bot talks to the user in a way as natural as possible.
The project is divided in 2 primary phases namely:
NLU/NLP:
In this phase, the team has to create its own dataset. The
dataset will be in the form of entities and intents. The bot
identifies the intents and entities from the statements and
responses given by trainee. The model will help the bot to
understand the trainee language.
Core:
In this phase, in addition to understanding, the bot will also
look for the flow. There is always a sequence to carry out any
task. Similarly, there should be a flow while talking to the bot
as well. No matter what the trainee replies/asks off the topic,
the bot should be able to remember the flow and bring the
trainee back into the flow. The story, where the utterances
and actions are kept, is created here in this phase. The
training will be done over the story dataset and the result is
recorded accordingly.

3|PAGE
The Stakeholders? Primarily the people imparting and
prescribing “yogasanas” i.e. Yoga teachers will be most likely
to feel an impact after the chat bot’s deployment. For the
Clients who are more comfortable connecting via phone, the
telephone executives may be alleviated of call burden as the
bot will be intelligent enough to mock a real person over chat.

Data availability? The real challenge was the data


availability. The Data was aplenty. However, the information
content was very low in each piece of data. We had to set up
manually created mock stories/scenarios to emulate the
conversation between a user and a trainer. Also, we had to
scavenge for knowledge about Yoga and its benefits.
Recommendations by doctors about performing yoga of an
individual in a particular state were also gathered.
Below are the few sources:
[Link]
[Link]
[Link]

[Link]
answered-questions-yoga

[Link]
#can_i_do_the_asanas_by_myself_with_the_help_of_a_yoga_
book

4|PAGE
[Link]

Platform options?
We explored many platforms prior to focusing on RASA
framework for developing the chatbot. Few of them were
namely and . A functional bot was
created on [Link] but added complexity and cost forced us to
abandon the platform.
However, the RASA framework seemed to be a better choice
than the others because of the following reasons:
• Complexity: both the other platforms were technically
complex and consumes majority of the time
understanding the platform rather the business problem.
• Security: [Link] and Dialog flow were both cloud-based
systems. They provide software as service (SaaS). We
intended to create models which would be insulated
from others.
• Cost: [Link] has 2 options namely standardized and
enterprise. The enterprise edition requires an upfront
initial cost.
• RASA stack is very flexible programmatically and has a
strong community to support. JS APIs facilitates easy
data creation.

5|PAGE
THE RASA STACK: DEEP DIVE
Rasa NLU’s job is to interpret messages, and Rasa Core’s job is
to decide what should happen next.
The Rasa Stack is a framework to build contextual AI
assistants and chatbots. It consists of two open source
libraries (Rasa NLU and Rasa Core). Using state-of-the-art
machine learning, your bots can hold contextual
conversations with users. 

The Rasa Stack is a pair of open source libraries (Rasa NLU


and Rasa Core) which takes free form text and converts it into
structured data.

6|PAGE
Rasa Core performs Dialog Management, which means
keeping track of a conversation, and deciding how to proceed.
Both Rasa Core and NLU use Machine Learning to learn from
real example conversations. Rasa NLU and Core are
independent. You can use NLU without Core, and vice versa.
Below We will understand how actually the chat bot works.
The first job of Rasa NLU is to assign any given sentence to
one of the intent categories: greet, workout, thankyou etc.
The second job is to label words like “Surya_namaskar” and
“yoga” as cuisine and location entities, respectively.
Below are the steps which needs to be followed:
RASA_NLU:
1. Prepare your NLU Training Data:
Training data is essential for developing chatbots and
voice apps. The data is just a list of messages that you
expect to receive, annotated with the intent and entities
Rasa NLU should learn to extract. The best way to get
training data is from real users, and a good way to get it
is to pretend to be the bot yourself.
2. Define your Machine Learning Model:
Rasa NLU has a number of different components, which
together make a pipeline. 
nlu_config.yml

7|PAGE
3. Train your Machine Learning NLU model:
<HOW>
RASA Core:
This diagram shows the basic steps of how a Rasa Core app
responds to a message:

The steps are:


1. The message is received and passed to an Interpreter,
which converts it into a dictionary including the original
text, the intent, and any entities that were found.
2. The Tracker is the object which keeps track of
conversation state. It receives the info that a new
message has come in.
3. The policy receives the current state of the tracker.
4. The policy chooses which action to take next.

8|PAGE
5. The chosen action is logged by the tracker.
6. A response is sent to the user.
The process is handled by the rasa_core.[Link] class.
Below are relevant to RASA Core:
1. Write Stories:
A story starts with ## followed by a name (the name is
optional). lines that start with * are messages sent by the
user. Although you don’t write the actual message, but
rather the intent (and the entities) that represent what
the user means. If you don’t know about intents and
entities, don’t worry! We will talk about them more
later. Lines that start with - are actions taken by your
bot. In this case all of our actions are just messages sent
back to the user, like utter_greet, but in general an
action can do anything, including calling an API and
interacting with the outside world.
<EXAMPLE OF [Link] file>
2. Define a Domain:
The next thing we need to do is define a Domain. The
domain defines the universe your bot lives in.
<[Link]>
<PASTE the [Link]>

9|PAGE
What the different parts mean:

intents things you expect users to say.


actions things your bot can do and say
template
s template strings for the things your bot can say
entities pieces of info you want to extract from messages.

slots
information to keep track of during a
conversation

Rasa Core’s job is to choose the right action to execute at


each step of the conversation. Simple actions are just
sending a message to a user. These simple actions are
the actions in the domain, which start with utter_. They
will just respond with a message based on a template
from the templates section.
3. Train a Dialogue Model
The next step is to train a neural network on our
example stories.
This will train the dialogue model and store it
into models/dialogue.

10 | P A G E
4. Talking to The Bot
Now we can use that trained dialogue model to run our
bot. We haven’t included an NLU model yet, however
the bot will be able to comprehend structured data.
But we will include the NLU model as well 😊

5.  Add NLU
An interpreter is responsible for parsing messages. It
performs the Natural Language Understanding (NLU)
and transforms the message into structured output. In
this example we are going to use Rasa NLU for this
purpose.

In Rasa NLU, we need to define the user messages our


bot should be able to handle in the Rasa NLU training
data format. In this tutorial we are going to use
Markdown Format for NLU training data. Let’s create
some intent examples in a file called [Link].
<PLEASE Put output of [Link]?? or json?>

We also need the nlu_config.yml.


<Please put the file nlu_config.yml>

11 | P A G E
12 | P A G E
13 | P A G E
14 | P A G E

FITAI CHATBOT
AN INTELLIGENT DIALOGUE SYSTEM

You might also like