Bot says you repeat yourself

Hi, I am new to Rasa. I have just installed the core and trained the bot with some examples and if the user repeats the same words, I would like the bot to answer : you repeat yourself. Like:

-user: how are you? how are you? how are you ? -bot: you repeat yourself. Or -user: how are you? -bot: fine. -user: how are you? -bot: you repeat yourself.

Is that possible? Thanks.

You could include a slot of intents of messages the user has sent and if they send a message with an intent already present in the slot send the “You repeat yourself” message.

Ok thank you. I’ll give a try.

Hi, I did as you suggested. I created a new slot “user_message” and a custom action to get the latest user message with “tracker.latest_message[‘text’]”. The idea is to send the user messages one by one to that slot and to compare any new user message to what is already in the slot (the previous user message). If the two messages are similar, the bot says “you are repeating yourself”. But the problem is: because it is a custom action, it is not continuously triggered during the dialogue, but depends on certain conditions defined in the stories. So how do I continuously send ALL the user messages of any conversation to the slot “user_message”? Is there a way to do that with a custom action? Or do I need to add that action to the pipeline? Thanks.

Hi,

AFAIK this is a function that is not supported in the rasa core master. You can either run the custom action after each intent, before you run utters or other actions or you can hard code it in the rasa core files on your system. You’d need to add a function to… I think processor.py. I might be wrong though :smiley:

Hi! Running it after each intent would be quite laborious. What do you mean by “it is not supported in the rasa core master”? Do you mean it can’t be implemented to the pipeline with a python script? I have added the Sentiment Analysis script to the pipeline to try it out (Enhancing Rasa NLU models with Custom Components), so I suppose it should be possible with another script about user messages.

Now I face another problem. Suppose when I say “hello”, the bot responds “hi”, unless I have already said “hello” in my previous message. In that case, the bot should only respond “you are repeating yourself”. But because the custom action doesn’t stop what normally follows in the story, the bot will also add “hi”. And that is not what I want… So, in case the user repeats himself, how my custom action can stop the bot message that normally follows the user message? I hope I am clear enough. Thanks.

I could solve my problem by adding “return [FollowupAction(“action_listen”)]” to the custom action script in case the bot detects the two last user messages are identical. So if the user repeats the same message, the bot now only responds: “You are repeating yourself”.

Glad to see you’ve found a solution for your second problem yourself. Indeed: Pass an action_listen in your custom action.

Yes, this is what I suggested when I said

Still a valid option. I have no clue how to do it though. You’re more of a programmer than I am, I’m sure.