How to understand natural language?

Artificial intelligence (AI) unites a variety of technologies, such as image and voice recognition, NLP and so on. We will concentrate on Natural language processing or understanding (NLP).

In reality a chatbot is not able to understand a human being, however he is able to fake it. Check it out.

We have already discussed the intents in Analytics chapter. It is any NLP system’s job to derive an intent from a human message.

Ok, let's imagine the conversation:

Human: “How is the weather in San Francisco today?”

Bot: “Mostly sunny, 68ºF, in San Francisco today”.

It looks like a chat between two human beings, right? See how it works:

  1. The human message is saved to the variable %question=How is the weather in San Francisco today?
  2. The request is sent to NLP.
  3. NLP defines the following elements in the message: city name (%city=San Francisco), time (%date=today) and intent (%intent=weather).
  4. The chatbot receives all variables %city, %date and %intent.
  5. By determining the %intent=weather variable the bot goes to the weather map.
  6. Then it refers to the weather web service and asks for weather forecast for today. This is how we get the answer: %weather=Mostly sunny, 68ºF.
  7. That's it! The bot only has to reply with the answer %weather, in %city %date (Mostly sunny, 68ºF, in San Francisco today).

NLP allows to build magic conversations. There are quite a few NLP services. Try dialogflow.com for instance. To connect it to your bot you need to customize the following settings in the @default node:

Click icon to copy this map or open it in