- Cognitive Computing with IBM Watson
- Rob High Tanmay Bakshi
- 325字
- 2021-06-24 15:02:36
Creating the dialog for a complex Intent using Frame Slots
Now let's examine a slightly more complex case. In the Try it out panel, enter Transfer money to my mother's savings account. You should see it come back with something like this:
In this case, Watson has recognized the intent to transfer money to my mother's account. Again, we can imagine the application resolving who my mother is by looking up my account relationship information—perhaps that is an account that I had previously identified as a linked account. However, as straightforward as this little interaction seems, it might be somewhat unsatisfying for the end user. After all, how much does the user want to transfer, and from what account should the transfer be made?
To make this more complete, we need to do a bit more work.
In this case, we're going to create what we call a frame-slot dialog. That is, a dialog whose goal is to fill in all the information needed to complete the transaction. We'll use the #Funds-Transfer intent to demonstrate this. Transferring money between accounts depends on three things: the amount to transfer, where to take it from, and where to put it. We'll show you how to add this additional level of sophistication now.
We will begin adding another node to the dialog. Press the Add node button on the Dialog pane:
In the edit window, you can set this node to look for #Fund-Transfer, and then press the Customize button:
Pressing Customize will bring up a dialog box, where you can turn on and apply slot-processing for this node:
This will open the dialog node to a set of slots, and we can begin by creating a slot for gathering the from account information. Fill in @Accounts in the Check for field, $FromAccount in the Save it as field, and What account do you want to debit? in the If not present, ask field: