Recognizing entities

Now, let's talk about entities. In many of the examples I ended up using to train Watson, I included references to specific things. These are some examples I used:

  • How much do I have in checking?
  • What transactions have I done recently?
  • Put money in my wife's account
  • Pay my power bill

We can look at one of the preceding examples in the following screenshot:

Checking, I, recently, my wife, and my power bill are all examples of entities that qualify my intent. I specifically want to know how much money I have in my checking account—not just any account. I want to know about transactions that I have performed recently—not those that others have performed, and certainly not those that my wife may have made a while ago (note that statements such as recently and a while ago are both relative and somewhat ambiguous timeframes, requiring a certain judgement to evaluate).

So, we have to teach Watson to recognize these types of qualifications. We call those entities—essentially people, places, things, and timeframes.

There are two ways to identify entities in Watson.

The first is to go back to the intent examples you have provided. Mouse over to select the thing that represents an entity, for example power bill, and create or identify the name of that entity type:

The other approach to creating entities is to go into the Entities tab on the main conversation page and press the Add entity button:

You can create an entity for PersonalRelations:

Then, you can add values for Mother, Myself, Father, Daughter, Son, Husband, and Wife, for example, along with any synonyms for each of those. Now add any other entities that you think will be relevant to conversations about banking activities. We depict a few other entities you can create here:

In this case, we have created entities for Accounts, in addition to BillingInstitutions and PersonalRelations. And, again, you can test this out with the Try it button:

Note, that Watson recognized that I intended to #Pay-Bills and to do so for my @BillingInstitution:Power Company—identified as an entity that qualifies the intent. In addition to user-defined entities, Watson also supplies a list of predefined system entities. If you select System entities tab on the main Entity page, you will see a list of them:

You can introduce system-defined entities into your application by simply turning them On.

Now we have done enough to build a very basic chatbot. We could, for example, write an application that prompted for a text utterance from a user, calling the Watson Assistant service passing in the utterance, and the service would return with a classification value and entities. You could, in your application, take that result and use it to determine the outstanding balance of the power bill, and issue a transaction to transfer that amount to the power company.