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...
-
Five basic elements about reinforcement learning: agent, state, environment, policy, reward. Here is an example https://builtin.com/data-...
-
Comparison among bestText to Image AI generation Here are some results for "every success starts from small steps" 1) Dalle E 2,...
-
https://kubernetes.io/blog/2019/07/23/get-started-with-kubernetes-using-python/ A Kubernetes service - I’m using Docker Desktop with Kub...
-
grpd = df.groupby('name').size() print(grpd) grpd.reset_index().to_csv('result.csv')
-
https://www.topbots.com/4-different-approaches-natural-language-processing-understanding/
No comments:
Post a Comment