Personal Assistant to Cancel the Scheduled Reminder to Call

85 / 100

Oh.. I forgot to call you.

Oh.. I forgot that I had a meeting today.

Oh.. I forgot to attend the today’s session.

All of us may have said or have heard these kinds of sentences one or many times in our entire life. May be due to busy schedules or any other reason, and we must have lost many opportunities as well as relations. But not anymore, as I am back with a technical and the coolest solution for the same. Now, you can have a personal assistant in your pocket that can send you reminder for all your meetings, calls, meets, attending the seminars, and many more. We have discussed and implemented this step in our previous blog.

Suppose, now you have and update in your call or meeting. For example your meeting is postponed or cancelled. In that case, you have to tell your assistant about the update so that it will not remind you as per the previous time. But how do we do it, that’s all you will learn in this blog.

Now, lets discuss and implement it.

Implementation

For the implementation, it’s important for us to understand that what conversation flow we want to follow in this blog. So, here is the conversation that we will follow to make you understand abot this concept.

User: Hey buddy!
Bot: Hey, How can I assist you?
User: Actually my meeting has been postponed so don’t remind me for the meeting  now
Bot: Sure, No problem.

So, this is our conversation as per which we will make the changes and we will understand the how to cancel the scheduling.

As you have already seen in the previous blog, that how to schedule the reminder so here are the changes that you have to make in to the rasa files,

actions.py

class ForgetReminders(Action):
"""Cancels all reminders."""

def name(self) -> Text:
return "action_forget_reminders"

async def run(
self, dispatcher, tracker: Tracker, domain: Dict[Text, Any]
) -> List[Dict[Text, Any]]:

dispatcher.utter_message(f"Okay, I'll cancel all your reminders.")

# Cancel all reminders
return [ReminderCancelled()]

In the actions script, you can see I have created a class with the name “action_forget_reminders” in which we are just calling an utter message saying “Okay, I’ll cancel all your reminders.” which is actually not cancelling any reminders. Reminders are cancelled from the return statement where I have called “ReminderCancelled()”, which will cancel all the existing reminders.

It’s because by default if you will not pass any reminder name so it includes all the reminders that will be canceled. But if you will return “ReminderCancelled(“my_reminder”)” like this then it will only cancel the reminder with the name “my_reminder”. So in this way, we can cancel any reminder whether all or any specific.

nlu.md

## intent: ask_forget_reminders
- forget about it
- don't remind me!
- Forget about the reminder
- do not remind me
- Actually my meeting has been postponed so don’t remind me for the meeting now
- do not remind me!
- Forget reminding me
- Forget reminding me!

This is the intent that we created as the user input based on which our chatbot will cancel the scheduling.

domain.yml

intents:
- ask_forget_reminders:
triggers: action_forget_reminders
actions:
- action_forget_reminders

In the domain file, i have added the intent with name ask_forget_reminders which will trigger the action that we created for cancelling the schedule reminders.

You can also check this video for more clarification,

Before training the model and checking it’s working. Make sure you already have the data added for scheduling a reminder as we have discussed in the previous blog. Check the full code here:

Download Full Code for Reminder Schedule/Cancel bot

Now, train the model and test it with the given commands,

rasa train
rasa x

here is the output for the above code,

output of reminder

Time to wrap up now. Hope you liked our content on How does your personal assistant can help you cancel the reminder. See you in our next blog, thanks for reading our blog and do leave a comment below to help us improve the content to serve you all of our experience with you. Stay tuned with us for more Rasa Chatbot contents.

Also check out our other playlist Rasa Chatbot, Internet of things, Docker, Python Programming, etc.
Become a member of our social family on youtube here.
Stay tuned and Happy Learning. 🙂

Ashish Saini
Ashish Saini

I am a software developer for Python/Machine Learning. Also, I’m Rasa Hero at Rasa. Also, I’m a youtuber where I regulary uploads the videos to help this generation learn about the technology just like they are playing games.

Leave a Reply

Your email address will not be published. Required fields are marked *