InvalidConfigException while handling Two Stage Fallback

I see the below error when I attempt to handle Two Stage Fallback.

sh-4.2$ rasa train /home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/rasa/shared/nlu/training_data/formats/markdown.py:56: FutureWarning: NLU data in Markdown format is deprecated and will be removed in Rasa Open Source 3.0.0. Please convert your Markdown NLU data to the new YAML training data format. docs=DOCS_URL_MIGRATION_GUIDE_MD_DEPRECATION, 2021-08-16 09:39:58 INFO rasa.model - Data (core-config) for Core model section changed. 2021-08-16 09:39:58 INFO rasa.model - Data (nlu-config) for NLU model section changed. 2021-08-16 09:39:58 INFO rasa.model - Data (nlg) for NLG responses section changed. Training NLU model… InvalidConfigException: The pipeline configuration contains errors. The component ‘FallbackClassifier’ requires ‘IntentClassifier’ to be placed before it in the pipeline. Please add the required components to the pipeline.

My config.yml is as below -

language: en

pipeline:

– name: FallbackClassifier threshold: 0.7

policies:

– name: RulePolicy


I don’t know what I need to change to fix the issue. Please advise. Thanks in advance.

As the erro says, you need to add IntentClassifier before FallbackClassifier in the pipeline. You can also use DIETClassifier.

Please read How to Choose a Pipeline and Choosing the Right Components.

You could build a pipeline like so:

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
    epochs: 100
  - name: FallbackClassifier
    threshold: 0.7

It is very important to know how to build and modify a pipeline, as it is the whole process of understanding the user input.

But, do I need WhitespaceTokenizer, DIETClassifier, LexicalSyntacticFeaturizer etc. to get the two-stage fallback mechanism working?

Yes of course.

For FallbackClassifier, you especially need DIET. DIET is what finds your intents and entities. Without something that classifies the intents, how can you fallback on them?

You cannot build a chatbot without understanding text preprocessing and processing. Again, please read How to Choose a Pipeline and Choosing the Right Components. On top of that, read about the different Pipeline Components and their roles. For more technical details, you can watch Rasa’s Algorithm Whiteboard playlist.