Small talk using Response selector - random responses

Hi! I’ve tried to create a simple chatbot handling small talks, I’ve used Response selector to easily handle stories and responses. I was inspired by the rasa demo project where each “chitchat” in file has multiple possible responses. Everything works fine except the fact that the bot always responses with the first defined response (“How are you?” -> “I’m great! Thanks for asking.”). I assumed that the bot will randomly choose from this list of responses but it doesn’t do that. I also noticed the same behavior of rasa demo chatbot so maybe it’s some general issue or do I understand it wrong? Thanks!

My files:

## chitchat - howdoings
* chitchat/ask_howdoing 
  -  I'm great! Thanks for asking.
  -  I'm good, thanks!
  -  A little bit too warm, otherwise fine.
  -  A little bit cold, otherwise fine.
## chitchat - howold
* chitchat/ask_howold 
  -  Old enough to be a bot!
  -  '42'
  -  Age is just an issue of mind over matter. If you don’t mind, it doesn’t matter.
  -  Never ask a chatbot her age!

## intent:chitchat/ask_howdoing
- Ahoy matey how are you?
- Are you ok?
- Do you feel good?
- How are you
- How are you men?
- How are you today?
- How are you?
- How was your day?
## intent:chitchat/ask_howold
- Do you have friends the same age as you, if so, how old are they?
- How long have you been alive?
- How long have you been around?
- How long have you occupied the earth?

## chitchat
* chitchat
    - respond_chitchat


language: en
  - name: ConveRTTokenizer
  - name: ConveRTFeaturizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: "char_wb"
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 100


I just start exploring this ResponseSelector class so I’m quite curious about this as well. However, as of last December, random answer for response selector was not possible as stated here. The interesting part is, rasa-demo’s implies that it is possible, or it will be possible in the future, to choose random responses from possible responses.

As my knowledge on response retrieval model, randomize responses for ResponseSelector is very tricky to do out-of-the-box without any post-processing function since retrieval model is basically measuring similarity ranking between encoded input and output.

I’m sorry to mention, but any comment on this @erohmensing?

@tomgun132 you’re right on the money, it’s still not possible. In fact you make a good point about our demo bot’s responses – although we have multiple listed there, the first one is the only one that is actually ever chosen. The multiples listed there are legacy from when they had their own intents.

Being able to handle random responses is a popular feature request, even internally from our team in charge of the demo :smiley:We’re currently working on changing the training data formats, so whether or not this feature will be implemented, I think it’s waiting on that first.

Hi @erohmensing,

Sorry to jump into the conversation, I got a question, Is it feasible for single bot to answer multiple users questions in platforms like Facebook, Twitter, Whats app. Where user-1 is on story-1 and user-2 story-2 simultaneously. If that happens will it affects the bot performance in response. If so does single bot have the capability to do multi threading or is it task based operations? just curious.



Yep! You can define all of your channels in credentials.yml and it will serve all of the users simultaneously. Rasa processes requests asynchronously, so you shouldn’t notice any issues with performance even if you have long-running actions.

1 Like

Thank you for your answer, @erohmensing! I’m looking forward to some solution to this issue in the future, it would make it much easier to manage this kind of chats. :slightly_smiling_face:

Btw, @tomgun132, do you have any suggestions on how to deal with a lot of “similar” intents such as chitchat and random responses to it? I can only think of making separate intent and story for each chitchat and define responses in the domain file. :thinking:

@lukasch As I just started working on this as well, I can’t really give a good suggestion. I can think of few ways but I haven’t personally done it or currently experimenting with it. First is just like what you mentioned, you need to create a lot of similar intents and create a complex story for it, which probably will make the chatbot unstable. Second one requires some post-processing, for example in your first post, if the retrieval intent class is chitchat/askhowdoing and in the you have multiple responses for it, create a list out of those answers and randomly choose 1 out of the responses.

1 Like