-
Notifications
You must be signed in to change notification settings - Fork 5
Building a Rule Based Weather Bot
Amitha R edited this page Oct 13, 2018
·
11 revisions
- 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.)
- Expected output - node app.js (vanillaChatbot code);
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!
Interactive Terminal interface (cmd) ---> Patter Matcher --[--> Regex Pattern Dictionarry -->]--Entity Extractor ---> Yahoo weather API ---> Response Parser --[--> Sentence Formation Helper Dictionary -->] --> CMD.
Pre-Requisite - Nodejs - Runtime environment that uses Javascript to build server-side applications.
- Create a folder -> npm init - initialize a project - package.json file.