Differentiating Subjects from Objects

Let's see how we can make our chatbot differentiate between subjects and objects.

Recall that a sentence has two important grammatical components: a subject and an object. The subject is the person or thing that performs the action given by the verb of the sentence:

Mary picked up her brother.

He was a great performer.

It was rainy on Sunday.

Who is responsible for this mess?

The cat is very cute.

Seeing you makes me happy.

A subject can be a noun, a pronoun, or a noun phrase.

An object is the thing or person on which the subject performs the action given by the verb. An object can be a noun, a pronoun, or a noun phrase too. Here are some examples:

Lauren lost her book.

I gave her/direct object a book/indirect object.

So far, so good, but how does this information help us in our chatbot NLU?

Extracting the subject and the object helps us understand the sentence structure, hence adding one more layer to the semantic parse of the sentence. Sentence subject and object information directly relate to answer generation. Let's see some examples of utterances from our dataset:

Where is this restaurant?

The following figure shows the dependency parse of this utterance. The subject is the noun phrase this restaurant:

Get hands-on with 1200+ tech skills courses.