LEVEL 3: Integrating RASA Core dialogue management model with Slack Messenger User Interface:
You can follow the video with the given link here from 1 hour and 23 minutes for better understanding.
1. Configuration of Slack API:
· Open URL with https://api.slack.com/.
· Click on Start Building. Create a Name for App and choose Development Slack WareHouse. If there is no workspace is available, then you need to create the one. Then click on create App.
Once you have created slack app name, basic information page will open.
Create Bot user and also tick Always show My bot Online.
2. Create rasa_slack_connector.py file which will be used as SlackInput:
It will take messages from Slack and it will provide them to RASA Core whenever it is needed.
3. Configuration of run_app.py:
· This file interprets from weathernlu model which has been created from RASA NLU and loads agent from dialogue model which has been created from RASA Core.
· SlackInput takes App Verification token, Bot Verification token under OAuth & Permission tab and Slack Verification token under Basic Information tab.
· Slack runs on http server with 5004 port.
· Command: python run_app.py
4. Ngrok Configuration:
· Ngrok should be download and run with http port 5005
· Command: ngrok http 5004
· Forwarding URL should be copied and pasted into Slack Event Subscription as mentioned below:
· https://bef1381fe.ngrok.io/slack/events and save changes.
· Now, you can open your chatbot in Slack and start conversation.
5. Connecting a chatbot to Slack:
· Configure the slack app as mentioned in above points.
· Make sure custom actions server is running.
· Start the agent by running run_app.py file (don’t forget to provide the slack_token)
· Start the ngrok on the port 5004
· Provide the url: https://your_ngrok_url/webhooks/slack/events to ‘Event Subscriptions’ page of the slack configuration.
Talk to your bot. Hip Hip Hurray !!!
LEVEL 4: Understanding Spacy and different algorithm underneath of RASA NLU and RASA Core:
· Spacy Pipeline: The article provided by Bhavani Ravi in 3 different parts — Demystifying RasaNLU explains how chatbot works. The links mentioned below explains in depth understanding of RASA NLU.
· Algorithm underneath of RASA NLU and RASA Core:
1. RASA NLU: NLP (Natural Language Processing)
o Spacy NLP
o SpacyTokenizer (Converts to Tokens)
o SpacyFeaturizer (Converts tokens to vectors) Word2Vec
o EntityExtractor (NER_CRF) (Named Entity Recognition with Conditional Random fields)
— Sequential Statistics Model
— Every feature is dependent on feature before and after it and it is important to preserve the order.
— BILOU Tagging (Begin, Intermediate, Last, Others, Unigram)
— Convert into CRF format
— Predict in JSON Format
— Tokenize text to words.
— Convert words to features
— Word2Vec Algorithm (N-Dimensional Space)
— Labeling Featuers
— Supervised Word Vector algorithm
2. RASA CORE (Next Action):
1. Policies: Choose Next actions
· Memoization Policy: Remembers or byheart the previous actions
· Keras Policy: RNN (Recurrent Nueral Networks) Long Term Short Memory
NOTE: For all the code I have added into this article are not aligned. Kindly refer to Github for actual code.
Kindly let me know your feedback or input to make this article much better along with your claps and also, if you are facing any issue regarding creating of Weatherbot.
Well, that’s the end of my implementation and understanding of making a simple chatbot using RASA NLU and RASA core. I had multiple links and documents some of which mentioned below.
Useful Reference Links:
· Special thanks to Justina Petraitytė who has guided me to do my first Weatherbot from here.
· In-depth understanding of RASA NLU given by Bhavani Ravi in her Demystifying RASA NLU series.