rasa icon indicating copy to clipboard operation
rasa copied to clipboard

Issue with Spacy component with e2e storied

Open iovigi opened this issue 3 years ago • 12 comments
trafficstars

Rasa Open Source version

3.0

Rasa SDK version

No response

Rasa X version

No response

Python version

3.9

What operating system are you using?

Windows

What happened?

Hello, I am using Rasa 3.0. I am trying to build a Rasa project with Spacy component in my pipeline, it is working fine in "normal" case, but when I try to train it with an end-to-end story, it is throwing "raise GraphSchemaValidationException( rasa.engine.exceptions.GraphSchemaValidationException: Your model uses a component 'SpacyNLP' which needs the param 'model' to be provided to its method 'process'. Please make sure that you registered your component correctly and that your model configuration is valid. See https://rasa.com/docs/rasa/custom-graph-components for more information.". I have provided the model and installed it. My config is:

  1. The config recipe.

  2. https://rasa.com/docs/rasa/model-configuration/

recipe: default.v1

  1. Configuration for Rasa NLU.

  2. https://rasa.com/docs/rasa/nlu/components/

language: bg

pipeline:

  1. No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.

  2. If you'd like to customize it, uncomment and adjust the pipeline.

  3. See https://rasa.com/docs/rasa/tuning-your-model for more information.

  • name: "SpacyNLP"
  1. language model to load

model: "bg_pipeline"

case_sensitive: False

  • name: SpacyTokenizer

  • name: SpacyEntityExtractor

  • name: SpacyFeaturizer

pooling: mean

  • 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.3

ambiguity_threshold: 0.1

  1. Configuration for Rasa Core.

  2. https://rasa.com/docs/rasa/core/policies/

policies:

  1. No configuration for policies was provided. The following default policies were used to train your model.

  2. If you'd like to customize them, uncomment and adjust the policies.

  3. See https://rasa.com/docs/rasa/policies for more information.

    • name: MemoizationPolicy
    • name: RulePolicy
    • name: UnexpecTEDIntentPolicy
  4. max_history: 5

  5. epochs: 100

    • name: TEDPolicy
  6. max_history: 5

  7. epochs: 100

  8. constrain_similarities: true

It is working with a normal story, the issue appears only with an end-to-end story. Please advice

Command / Request

No response

Relevant log output

No response

Defnition of Done

  • [ ] Determine if the issue is a more general issue of the graph architecture or only specific to e2e

If it's e2e, then put this on deprio on the research board.

iovigi avatar Dec 14 '21 15:12 iovigi

Exalate commented:

sara-tagger commented:

Thanks for the issue, @koernerfelicia will get back to you about it soon!

You may find help in the docs and the forum, too
🤗

sara-tagger avatar Dec 15 '21 07:12 sara-tagger

Exalate commented:

koernerfelicia commented:

Can confirm this. To reproduce on examples/e2ebot:

use config:

recipe: default.v1 language: en pipeline:

  • name: "SpacyNLP" model: "en_core_web_md" case_sensitive: False
  • name: SpacyTokenizer
  • name: RegexFeaturizer
  • name: LexicalSyntacticFeaturizer
  • name: CountVectorsFeaturizer
  • name: CountVectorsFeaturizer analyzer: char_wb min_ngram: 1 max_ngram: 4
  • name: SpacyEntityExtractor
  • name: DIETClassifier epochs: 200 policies:
  • name: TEDPolicy epochs: 200

error message:

rasa.engine.exceptions.GraphSchemaValidationException: Your model uses a component 'SpacyNLP' which needs the param 'model' to be provided to its method 'process'. Please make sure that you registered your component correctly and and that your model configuration is valid.See https://rasa.com/docs/rasa/custom-graph-components for more information.

koernerfelicia avatar Dec 15 '21 08:12 koernerfelicia

Exalate commented:

koernerfelicia commented:

Training seems fine if you comment out the text from the stories like so:

....

  • story: accepts suggestion, indirectly steps:
  • intent: greet
  • action: utter_greet
  • intent: search_restaurant
  • action: utter_suggest_cuisine
    • user: "I can always go for sushi"
    • action: utter_search_restaurants
  • story: rejects suggestion, indirectly steps:
  • intent: search_restaurant
  • action: utter_suggest_cuisine
    • user: "I had that yesterday"
    • action: utter_suggest_cuisine

koernerfelicia avatar Dec 15 '21 08:12 koernerfelicia

Exalate commented:

CharlesSQ commented:

Training seems fine if you comment out the text from the stories like so:

....

  • story: accepts suggestion, indirectly steps:
  • intent: greet
  • action: utter_greet
  • intent: search_restaurant
  • action: utter_suggest_cuisine

- user: "I can always go for sushi"

- action: utter_search_restaurants

  • story: rejects suggestion, indirectly steps:
  • intent: search_restaurant
  • action: utter_suggest_cuisine

- user: "I had that yesterday"

- action: utter_suggest_cuisine

Hello, I'm having the same issue but I need to use end-to-end stories because that's the main reason I'm moving to rasa 3

CharlesSQ avatar Dec 16 '21 15:12 CharlesSQ

Exalate commented:

koernerfelicia commented:

@CharlesSQ thanks for the input. That comment was just intended to support those who will investigate the bug, it's definitely not a fix or workaround! It's been routed to the relevant teams, and we'll be working on a fix once it's been triaged

koernerfelicia avatar Dec 17 '21 12:12 koernerfelicia

Exalate commented:

rgstephens commented:

I think this issue isn't confined to e2e. I was able to duplicate this issue by doing:

  • rasa init
  • Add SpacyEntityExtractor to the pipeline
  • rasa train

@koaning, have you used Spacy with 3.0?

rgstephens avatar Feb 04 '22 05:02 rgstephens

Exalate commented:

koaning commented:

@rgstephens could you share the full config.yml file? I'm assuming that you've added a SpacyNLP object to your pipeline in order to get the SpacyEntityExtractor to work.

I haven't started a new project with Rasa using spaCy, but the CI passed since we upgraded ... so this is a bit strange.

koaning avatar Feb 04 '22 15:02 koaning

Exalate commented:

koaning commented:

I was just able to run pipelines just fine with the spaCy tokenizer and featurizer. I did hit a minor developer experience bug, explained here: https://github.com/RasaHQ/rasa/issues/10814.

koaning avatar Feb 04 '22 15:02 koaning

Exalate commented:

koaning commented:

To confirm, this was the pipeline that I tried on rasa init. It trained just fine.

pipeline:

*   name: SpacyNLP
     model: en_core_web_md
*   name: SpacyTokenizer
*   name: SpacyFeaturizer
*   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: SpacyEntityExtractor
*   name: FallbackClassifier
     threshold: 0.3
     ambiguity_threshold: 0.1

These were my version numbers.

Rasa Version : 3.0.6 Minimum Compatible Version: 3.0.0 Rasa SDK Version : 3.0.4 Rasa X Version : None Python Version : 3.8.12 Operating System : Linux-5.13.0-1012-gcp-x86_64-with-glibc2.29 Python Path : /home/gitpod/.pyenv/versions/3.8.12/bin/python

koaning avatar Feb 04 '22 15:02 koaning

Exalate commented:

rgstephens commented:

I forgot to add SpacyNLP. When someone looks at this issue, it would be nice to improve the error message.

 - name: SpacyNLP
 model: "en_core_web_md"

rgstephens avatar Feb 04 '22 17:02 rgstephens

With end-to-end learning the issue still exists.

yuqiong11 avatar Jul 04 '22 19:07 yuqiong11

Did anyone find a solution for this bug?

shankar-avizva avatar Jul 05 '22 19:07 shankar-avizva

➤ Maxime Verger commented:

:bulb: Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

:arrow_right: More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

sync-by-unito[bot] avatar Dec 16 '22 10:12 sync-by-unito[bot]