To illustrate we will consider a chatbot written for a second hand electronics store. The samples of expected user input might be something like:
- I want to sell my old iPhone
- I need a new laptop
- I am interested in buying an new iPad
In examples 2 and 3 the user's intent is to buy, while in example statement number 1 the intent is to sell. When designing a conversational agent you define the intents by giving examples of what you expect users with this intent to say. In a real system you would need to give many more examples to give Watson a better chance of guessing the users' intent, but this is enough to illustrate the way it works..
There are different ways to specify entities. The most common one is to give samples of the entity values. For example, if we had an entity @device and the possible values were 'phone', 'tablet' and 'laptop' - we would specify the entity as shown below by giving examples of what the user might say for each type of entity.
The second way of specifying an entity is with a regular expression. This is useful in cases where you want to catch an email address or phone number. In this cases it is not feasible to exhaustively list all possible inputs, but the rules for what an email address or phone number look like are easy to specify in a regular expression.
The third option for entities is to use one of the predefined system entities. For example, you might use the @sys-date entity a simple way to capture mentions of a date without having to go to the trouble of specifying a complex regular expression. This also has advantages such as when the user types 'tomorrow' the entity extracted is the correct date for the day after they typed it.
Many developers of chatbots don't realise that you can combine entities with intent examples to make them more powerful. If you specify your examples like this:
- I want to sell my old @device
- I need a new @device
- I am interested in buying a new @device
No comments:
Post a Comment