Request for retrieval-based configuration(or github demo) for FAQ and chitchat in Rasa 2.0

I am trying to build a retrieval-based chatbot to make sure for certain questions bot answer in a controlled way. I use latest Rasa 2.0.2 I use docs from Chitchat and FAQs but i was unable to get it working. Before training i see yellow warnings that i have intent for chitchat in nlu that do not correspond to domain data, please check your domain.yml After training i do rasa shell in bot respond nothing.

Could anyone point me with correct config to Github demo project ? (or should i install older 1.8.3 ver)

Hi @BitcoinKing, could you paste here the exact warning that you’re getting? I’m curious to see if the warning mentions a retrieval intent like chitchat/howdoing or a simple intent like chitchat. Can you also make sure that the base intent (in this case chitchat) is listed in your domain?

I have to say that your issue sounds a bit like this one which we’re actively working on. In that case, downgrading to Rasa 1.x is unlikely to solve things :wink:

I think I’m running perhaps into a related issue that’s similar? I’m following the tutorial here: Chitchat and FAQs, and using the rasa interactive to see the responses from the bot, but I’ve been unsuccessful (I think). By unsuccessful, is that in the interactive, I get

? The bot wants to run 'utter_faq', correct?

But I think I should be ‘utter_faq/ask_bot’ or 'utter_faq/ask_insurance. This is because if I use what the interactive teaches the bot, it then adds new action utter_faq to my domain file.

My code:

nlu.yml

- intent: faq/ask_insurance
  examples: |
     - what type of insurance do you support?
     - do you only sell life insurance?
     - what kind of insurance do you sell?
- intent: faq/ask_bot
  examples: |
    - what can you help me with?
    - what can you do?
    - I want to learn more about you
- intent: chitchat/ask_you
  examples: |
    - can you share your boss with me?
    - i want to get to know your owner
    - i want to know the company which designed you
- intent: chitchat/ask_weather
  examples: |
    - How is the weather today?
    - What's the weather like?
    - How is the weather?

config.yml

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
  - name: WhitespaceTokenizer
  - 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
    retrieval_intent: faq
    epochs: 100
  - name: ResponseSelector
    retrieval_intent: chitchat  
    epochs: 100
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: TEDPolicy
    max_history: 1
    epochs: 100
  - name: RulePolicy

domain.yml

intents:
- chitchat
- faq

responses:
  utter_faq/ask_insurance:
  - text: I focuse on term life insurance.
  - text: At this time, I can only tell you about term life insurance.
  utter_faq/ask_bot:
  - text: Hi. I'm an life insurance quote robot. I can help you learn about term life insurance and get a quote.
  utter_chitchat/ask_you:
  - image: https://i.imgur.com/zTvA58i.jpeg
    text: I'm doing well. My job is a life insurance quote robot.
  - text: I'm good. I am a life insurance quote robot.
  utter_chitchat/ask_weather:
  - text: Oh, it does look sunny right now in Berlin.
    image: https://i.imgur.com/vwv7aHN.png
  - text: I am not sure of the whole week but I can see the sun is out today.

rules.yml

- rule: response to faq
  steps: 
  - intent: faq
  - action: utter_faq

- rule: response to chitchat
  steps: 
  - intent: chitchat
  - action: utter_chitchat

Hey @sparklie3 your issue looks like something different but it brings up and important point!

The fact that you see The bot wants to run 'utter_faq', correct? is fine I would say. The bot really should run the utter_faq action and because it happens to be an action associated with a response selector, it will in the end send to the user one of the responses, e.g. utter_faq/ask_bot.

When it comes to interactive learning adding utter_faq to your domain file: I don’t think it’s necessarily a bad thing, though I understand that it doesn’t have to be in the domain. Can you check that when the action is in the domain and you re-train the models, they behave the same?

But in any case, I think interactive learning should be changed to show all information (including full retrieval intents), at least when running with the --e2e option.

BTW, I got everything working. I was just confused in rasa interactive…with the utter_faq, but didn’t notice it was choosing the right retrieval intent and response texts.

If I add utter_faq and utter_chitchat as actions in the domain, I get warnings when I run rasa train, which makes sense:

UserWarning: Action ‘utter_faq’ is listed as a response action in the domain file, but there is no matching response defined. Please check your domain.

Other than that, nothing changes when I run rasa shell. I thought only custom actions are defined under actions: in the domain file. It was interesting to see rasa interactive auto add those.

I ran rasa interactive --e2e, but didn’t see anything different, so it would be helpful to show the specific retrieval intent, rather than just viewing the response text.

Furthermore, I did get an error this time in rasa interactive.

Encountered an exception while running action 'utter_chitchat'.Bot will continue, but the actions events are lost. Please check the logs of your action server for more 

information. > Traceback (most recent call last):

      File "/mnt/d/Documents/projects/rasa2.0/.venv/lib/python3.8/site-packages/rasa/core/processor.py", line 681, in _run_action
        events = await action.run(output_channel, nlg, tracker, self.domain)
      File "/mnt/d/Documents/projects/rasa2.0/.venv/lib/python3.8/site-packages/rasa/core/actions/action.py", line 313, in run
        response_selector_properties = tracker.latest_message.parse_data[
    KeyError: 'response_selector'

What is this response_selector here? Is it because I don’t have actions defined when using rasa interactive?

I think this needs to be fixed – we shouldn’t require response names under actions in the domain file.

Regarding this error that you’re getting: I’m struggling to reproduce it. Can you post your code and data? Or perhaps could you check if you still get the error when you re-train the model, run shell instead of interactive, etc.? It sounds like a bug, but let’s try to trace it down before creating an issue on GitHub :slight_smile:

Sorry for the slow response Sam, but I wasn’t able to reproduce it, so probably something I did rather than it’s a bug. Still learning

1 Like