Conversational AI with Rasa: Introduction to Rasa

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi my name is rachel and today i'm going to talk about what raza is how raza fits into the history of nlp and our approach towards building chatbots first of all we'll talk about what you can do with raza what was it designed to help you build really quickly go over a very brief history of nlp that's natural language processing if you're unfamiliar we'll talk about state machines versus neural methods what they are how they work how to use them and finally we'll talk about how to make sure that conversations with your chatbot actually work and improve over time so raza is designed to help you build a specific type of conversational system which is a task oriented dialog system so task oriented means the user wants to do something specifically they have a task they want to achieve and a dialogue system means that they achieve that task by talking to an automated system in a two-way conversation and this is different from other types of related systems like a chit chat bot where the goal is just to have an ongoing conversation with the assistant but not necessarily to actually do anything in particular so raza is a framework that makes it easier for you to build custom chat bots using a combination of machine learning approaches and heuristics or rules so the real core work of building your raza assistant is providing examples that your assistant learns from so how do people say things what are the different ways that people phrase the things that they want to to say to your assistant and how do conversations go what patterns do you want your assistant to be able to handle so razzi was built to be super customizable super flexible super extensible to be able to support a wide variety of projects and the downside of that is it does take a little bit more time to get started with a rasa assistant you know it's a full development environment it's a full framework but once you do you put in the time to get set up you should be good to go and this video series uh this is the first one and we'll be taking you through everything you need to know to build a rasa assistant for whatever it is that you need a chatbot for all right real quick history of uh natural language processing which is the field of using computers to interact with text data produced by humans so way back in the 1950s and 80s um there was a real focus on symbolic rule-based systems so elisa was one of the earliest chat bots it was completely rule-based and it was developed at this time and then in the 90s and 2000s in there the fuel started to shift to more statistical methods which basically means counting units of language so usually words and then in the 20 times there was another shift to instead of just counting these methods um using statistical models uh using deep learning models so neural networks in particular things like embeddings recurrent neural networks um lstms which are a type of neural network and starting in 2017 there was a shift yet again to a new family of neural methods namely transformers so if you've heard of gpt3 or bert or transformers themselves that's when that really starts to come in and raza really combines different aspects of the history of nlp so you can have rules to govern what your assistants can say next for things like extracting dates and numbers we recommend using regular expressions which are rule-based but for things like handling what to do next in a new situation your assistant hasn't seen before or having a more extensible generalizable way to understand what someone is saying to your assistant for that sort of thing we use neural methods so we're really using the most useful methods from from every period of the history of natural language processing so there's two main parts to a raza assistant or honestly any task-based dialogue assistant dialog system so the first is you understand the text so this task is often called natural language understanding and this is where you have raw text in so something that a human has produced and what you get out is machine readable information so this may be some sort of feature extraction it may be some sort of representation of what's in the text and the two methods that we use to do this are rule-based so things like regular expressions that find and extract email addresses which have a very predictable structure and the benefits of rule-based approaches are that you don't really need much or any data for these approaches you have to know what the patterns look like and be able to capture that with a rule but that's pretty much it um and because of this and the fact that they're they are rule-based they tend to be pretty fast they tend to be pretty lightweight but they can't handle things they haven't seen before right so if we started writing email addresses with an ampersand instead of an at sign a rule that's looking for an amp per an at sign is not going to be able to find the ampersand email addresses there are also neural approaches so an example of this would be something like a transformer based model so transformers are are that new architecture um for example diet which is one that we've developed here at rasa that sorts texts into intents or sorts of things that your users might say based on examples it's been provided so it's seen examples it has extracted a way to make decisions based on those examples and it can use that decision making for new examples that it hasn't seen before so the downside here is that you do need to have training examples and in general the more the better but it's a more flexible system than a rule-based system so this system might be able to handle the the ampersand type of email addresses if it's seen a wide variety of different types of email addresses so a rasa assistant generally uses both if you are for example extracting email addresses um it's usually faster and better to do that with a regular expression if you're trying to figure out all the different ways that someone may ask to order a pizza generally it's going to be better to do that using a neural method and then the next thing you have to do once you have all of this information in a featurized machine readable state is decide what to do next and the general task here is called a dialogue policy so this is what your assistant or chat bot will use to decide what to do next whether that's responding to the user executing some code that you've written elsewhere or just waiting for a response and given the response given your conversation so far what should your assistant do or say next so a rule-based way of doing this would be something like a big tree of all possible dialogue options if you've ever played a video game where you have different things that you can select to say and the conversation proceeds down that path that's a good example of a dialogue tree it's the traditional approach and it can work very well in interactions where you don't expect to have a lot of terms and everyone wants to do the same thing but they can't really handle digressions very well and when you get to the point where people are trying to have longer more complex conversations with your assistant a dialogue tree quickly becomes very difficult to maintain and update so these are also called state machines the other option is using a neural approach so this is based on deep learning based on transformers for example um so uh the the approach that we've developed in house is called ted um and these are all open source uh the tech picks the next best turn based on the conversation so far that it's seen um from all of the possible options that you have given it to respond so usually you'll pre-write your responses and it's selecting one so the downside here is that it requires training examples and again in general the more the better but a second upside to that is that you can use those training uh examples as kind of like mini sneaky rules by saying hey if you've seen this pattern of conversation before keep following the pattern that you've seen as training data right use the examples you've seen before and if those examples don't apply and a rule doesn't apply then you can use this uh this neural method to sort of guess what you think the most likely next best thing to do is so the bigger benefit of having this more flexible approach is that it allows users to have more flexible conversations they don't have to follow a fixed conversational path they can say other things and if your assistant has seen data that is you know well representative of the type of things that users are actually going to say to it you'll probably get a pretty good conversation that works so eraza we really recommend using both approaches in tandem for a hybrid system for your dialogue policies you've got your natural language understanding to get from text to features you've got your dialogue policy to decide what to do next how do you make sure that your conversations actually work how do you make sure that your users are getting what they need and how do you make sure that it's getting better and not worse over time well we recommend that you manually review and annotate them and then correct any errors that you notice your assistant making add that corrected data to your training data retrain your assistant and redeploy so doing basically ci cd but for a machine learning model that is running your your chat bot and as a result if you're following this process that we call conversation driven development you end up with an assistant that is not static right it's behaving predictably once you've trained it you can have the same exact conversations and you can also have conversations that you use to test your assistant to make sure it is doing what you think it's going to be doing but because you can retrain and redeploy very fluently you can also update your assistant as needed for example if people start to ask about something new you have a quick way to create a way to handle those conversations so this has been a very brief very high level overview of raza which is a machine learning rule-based framework to help you build chat bots specifically for task-oriented dialogue systems we've talked very briefly about the history of nlp and sort of situating raza in that history we've talked about state machines or rule-based systems versus neural networks both for understanding text and also deciding how to respond and we've also talked about how to make sure that conversations work can improve over time so from here i hope you are excited and ready to start building your first raza project and i look forward to seeing what you build
Info
Channel: Rasa
Views: 57,108
Rating: undefined out of 5
Keywords: chatbots, chatbot, nlproc
Id: Ap62n_YAVZ8
Channel Id: undefined
Length: 10min 44sec (644 seconds)
Published: Fri Jul 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.