Hi, I am working on building a chatbot which is supposed to ask the user a question like- “When task X should be done?” The user would reply saying something like- “half an hour later” or " after three hours" In return, the bot should reply- “Okay, I have scheduled the task X at 2:30 PM” Here, 2:30 PM is the relative time from the current time based on the user input. How can this functionality be achieved?
You can use Duckling to extract the time from user input. All you have to do is add the following lines in your
Duckling will then parse user input and return the system time with type time as an entity. You will have to train your bot with some data in your
nlu.md under some intent (e.g., ## intent:inform)
In your custom actions, you would then extract the value from entity e.g.
"timestamp": [self.from_entity(entity="time")] in your method
Arjaan Buijk very well explains this in the following webinar video:
You can also read more about Duckling at https://duckling.wit.ai/
Hi, thanks for your input. Am I supposed to install duckling separately? I tried doing what was suggested in the video but got this error: Failed to connect to duckling http server. Make sure the duckling server is running and the proper host and port are set in the configuration. How do I resolve this?
You need to start the duckling server separately using command
docker run -p 8000:8000 rasa/duckling