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: ...
-
Use Celery Celery is an asynchronous task queue based on distributed message passing to distribute workload across machines or threads. A c...
-
https://docs.min.io/docs/python-client-quickstart-guide.html The MinIO Python Client SDK provides simple APIs to access any Amazon S3 com...
-
I am working in the Artificial Intelligence area. I am thinking of two events happened to me. 1) I have the same dream over many years. Wh...
-
Recently, my Mac laptop's (Majove, MacBook Pro (15-inch, 2017)) Safari failed to open. I searched around and could not find a solution. ...
No comments:
Post a Comment