![]() ![]() This respond function accepts the user input and applies our trained Rasa interpreter to the text. We infinetly loop prompting for user input and passing it to the custom respond function. ![]() #Rasa github fullThe bulk of the code used for this interface can be seen below (the full script can be seen here). The other bot interface is from the command line. The resulting application is shown in the gif at the top of this post. The full Dash application code can be seen here. It uses similar logic to the command line interface that we’ll see next, but the output is much (prettier). The 1st interface was an excuse to write my first Plotly Dash application. I wrote up 2 interfaces that allow us to intereact with our respond function. Import json from rasa_nlu.model import Interpreter from rasa_nlu.config import RasaNLUConfig # read in modelĪrgs = ' ] Interacting with the Bot Generic template sentences were made up like the ones below. Since this is just a small effort I decided to go a less involved route. Rasa suggests to build up your actual training data by pretending to be the bot yourself this way you can collect real data from your users. So we have some generic intent classes, but we don’t have any training data for the intent of searching our app chart data. ![]() The resulting generic dataset can be found here. We’ll keep all these, but change the labels for restaurant_search to None (I additionally added some random sentences from Wikipedia to the None class). The provided data has some example phrases for the intents of greet, affirm, restaurant_search, & goodbye. In the spirit of being lazy resourceful, let’s use this example data has a starting point. Rasa provides some example data in their tutorial for building ‘A simple restaurant search bot’. Now let’s build up data for training our intent classifier. These 4 points of data will be our entity types in our NER model. The results were stored as a csv that contains columns for the app’s name, genre, rank, and chart. To gather this data a python script using BeautifulSoup was written. This project was trained on the Free, Top Grossing, and Paid categories for apps on the iTunes Charts. Like any machine learning project, we need to start off with some training data. However, I’ll share a high level overview of the steps taken to build the app rank bot, and we’ll go into detail when it doesn’t overlap with the docs. ![]() Rasa has great documentation, so we won’t go too in depth on general Rasa usage. In a real production chat bot, managing state is a must for your users to have a good experience. In this project we’ll leverage intent and NER, but the app rank bot will be stateless for simplicity. The cornerstone concepts for making chatbots are intent classification, named entity recognition (NER), and state management. Rasa is a powerful open source framework for building conversational & independent chatbots. A preview of the bot’s capabilities can be seen in a small Dash app that appears in the gif below.Īll the code used in the project can be found in this github repo. The bot has been trained to perform natural language queries against the iTunes Charts to retrieve app rank data. In this post I’ll be sharing a stateless chat bot built with Rasa. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |