Skip to content

Building a Rule Based Weather Bot

Amitha R edited this page Oct 13, 2018 · 11 revisions

Rule Based Weather Bot

How do Rule Based Bots work?

  • Human Input -> Match input to a pattern/rule -> Extract intent and data -> Process and create a response -> Human;
    • Intent - Subject of the conversation.
    • Entities - Actionable data components that the bot has to extract.
    • E.g - Will it rain in New York tomorrow? , Will it rain tomorrow in New York?
      • INTENT - Weather Forecast.
      • ENTITIES - rain, New York, tomorrow.
      • rain - weather | New York - location | tomorrow - time.
      • City :: New York | Weather :: Rain | Time :: Tomorrow.

Input (Intent / Entities) -> Intent Processor ---> Weather ---> [Weather API] ---> Weather --> Response Parse --> Response (Yes, there will be rain in New York tomorrow.)

Command Line Bot / Terminal Bot

  • Expected output

Hi

  • Hi to you too!

what is the weather like in bangalore

  • Let me check...
  • Right now, it is partly cloudy in Bengaluru, India. It is quite warm at 29 degrees Celsius.

what is it like in new york

  • Let me check...
  • Right now, it is cloudy in New York, United States. It is pretty cold at 10 degrees Celsius.

will it rain in tokyo tomorrow

  • Let me check...
  • Yes, there will be Rain tomorrow in Tokyo, Japan

will it rain in moscow day after tomorrow

  • Let me check...
  • No, it will be Sunny day after tomorrow in Moscow, Russia

bye

  • Have a great day!