I was recently introduced to RASA, a new chat bot which immediately captured my attention after playing with it.
Here I am using Python framework , following their own example as https://rasa.com/docs/core/quickstart/ and hopefully you can learn to practice it yourself.
However, I do divert from that a little bit to provide a better flow based on my experience.
Basically a conversation has question/answers. We just need make the bot understand our question and then provide a proper answer. Here is one example:
If we say: Hello/Hey/Hi/Good morning/Good afternoon/Hi, Hi/ Hi, Bot/, we are greeting the bot. The bot should understand this question ( here in RASA, it is called intent) and answer accordingly. The bot can answer as simple as "hey" or "hey, nice to meet you", or "hey, what can I do for you, etc" .
So we need build a system which understand the "intent", "action" based on the intent, then "answer" the human.
Here is the steps:
1) create the domain.yml file, which defines intent, actions, templates
intents:
- greet
actions:
- utter_greet
templates:
utter_greet:
- "Hello. Can I help you?"
2) create stories.md file, which define the story line
## general greetings
* greet
- utter_greet
3) training the model in the command line
python -m rasa_core.train -d domain.yml -s stories.md -o models/dialogue
4) run the chatbot in the command line
python -m rasa_core.run -d models/dialogue
5) or run the chatbot in non-stop mode as in the RASA tutorial
python sample_chatbot.py
The GitHub repo is https://github.com/chaowu2009/sample_chatbot_RASA
Subscribe to:
Post Comments (Atom)
How to Supercharge Your Python Classes with Class Methods
How to Supercharge Your Python Classes with Class Methods | by Siavash Yasini | May, 2024 | Towards Data Science As we just mentioned, a c...
-
https://rszalski.github.io/magicmethods/ __init__ __repr__ __getattr__ __setattr__ __call__(self, [args...]) context manager class Closer: ...
-
What is a Generalised Additive Model? What are Generalised Additive Models? | Towards Data Science 5.3 GLM, GAM and more | Interpretable M...
-
Five basic elements about reinforcement learning: agent, state, environment, policy, reward. Here is an example https://builtin.com/data-...
-
Use Celery Celery is an asynchronous task queue based on distributed message passing to distribute workload across machines or threads. A c...
-
• ENERGY CONSUMPTION https:// www.drivendata.org /competitions/51/electricity-prediction-machine-learning/page/101/ • TAXI ROUTE ...
No comments:
Post a Comment