0

I am studying Rasa and I'm having some problem with running the dialog model.

python3 -m rasa_core.train -s data/stories.md -d domain.yml -o models/dialogue --epochs 300

Error!

ruamel.yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/str'
in "/my/app/path/venv/lib/python3.6/site-packages/rasa_core/schemas/domain.yml", line 4, column 11

Rasa Core

Upon looking at the domain.yml from rasa_core, it seems that the problem is with double exclamation marks !!

domain.yml

allowempty: True
mapping:
  intents:
    type: !!python/str "seq"

Read, another post about double exclamation marks from here.

olleh
  • 1,248
  • 5
  • 16
  • 43

1 Answers1

1

Instead of trying arbitrary things, you should think about what you want to do. !!python/str is a tag denoting the Python string type. So your current YAML says „seq is a Python string`“.

Now your change would instead say „load the following value as whatever type you think is appropriate: !!python/str seq“. That is a very different thing.

Let's figure out why ruamel does not recognize your tag. A quick look in the source reveals that !!python/str is registered in the standard Constructor, but not in the SafeConstructor. That only has YAML's standard tag !!str available. So chances are that you are using the SafeConstructor which simply does not know about !!python/str. So a possible fix would be to use !!str instead which calls the same constructor on the scalar (as we see in the source).

Alternatively, you could just drop the tag. the scalar seq would be loaded into a string anyway unless RasaCore does something unexpected (I actually do not know anything about that).

flyx
  • 35,506
  • 7
  • 89
  • 126