Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rasa train fails when slot of type any contains a dictionary #7470

Closed
nbeuchat opened this issue Dec 7, 2020 · 2 comments · Fixed by #8142
Closed

Rasa train fails when slot of type any contains a dictionary #7470

nbeuchat opened this issue Dec 7, 2020 · 2 comments · Fixed by #8142
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/training-data Issues focused around Rasa training data (stories, NLU, domain, etc.) effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. feature:ux-cli+training-data Feature: Improve user experience with Rasa CLI and training data for developers type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@nbeuchat
Copy link
Contributor

nbeuchat commented Dec 7, 2020

Rasa version: 2.1.3

Rasa SDK version: 2.1.2

Rasa X version: 0.34.0

Python version: 3.7.9

Operating system: Ubuntu

Issue:
I created stories using interactive learning with Rasa X. Some actions fill a few slots of type any with a dictionary.

In the story steps, I have something like:

  - slot_was_set:
    - preferences_move_in_date:
        min: '2020-12-07'
        max: null

When training, I get a validation error for this story although the slot is of type any (and anyway it does not influence conversations) so I would expect the validation to go through.

I can manually remove these slots from these interactive learning stories but that is very time-consuming.

Error (including full traceback):

YamlValidationException: Failed to validate 'data/stories/interactive/0001_interactive.yml'. Please make sure the file is correct and all mandatory parameters are specified. Here are the errors found during validation:
  in data/stories/interactive/0001_interactive.yml:298:
      Cannot find required key 'intent'. Path: '/stories/0/steps/150'
  in data/stories/interactive/0001_interactive.yml:298:
      Key 'slot_was_set' was not defined. Path: '/stories/0/steps/150'
  in data/stories/interactive/0001_interactive.yml:300:
      Value 'ordereddict([('min', '2020-12-07'), ('max', None)])' is not of type 'text'. Path: '/stories/0/steps/150/slot_was_set/0/preferences_move_in_date'
  in data/stories/interactive/0001_interactive.yml:300:
      Value 'ordereddict([('min', '2020-12-07'), ('max', None)])' is not of type 'bool'. Path: '/stories/0/steps/150/slot_was_set/0/preferences_move_in_date'
  in data/stories/interactive/0001_interactive.yml:300:
      Value 'ordereddict([('min', '2020-12-07'), ('max', None)])' is not a list. Value path: '/stories/0/steps/150/slot_was_set/0/preferences_move_in_date'
  in data/stories/interactive/0001_interactive.yml:299:
      Value 'ordereddict([('preferences_move_in_date', ordereddict([('min', '2020-12-07'), ('max', None)]))])' is not of type 'str'. Path: '/stories/0/steps/150/slot_was_set/0'

Command or request that led to error:

rasa train

Content of configuration file (config.yml) (if relevant):

policies:
  - name: TEDPolicy
    max_history: 7
    epochs: 200
  - name: RulePolicy
    check_for_contradictions: true
    core_fallback_threshold: 0.3
    core_fallback_action_name: action_default_fallback  # customized in action server
    enable_fallback_prediction: true

Content of domain file (domain.yml) (if relevant):

slots:
  preferences_move_in_date:
    type: any
    influence_conversation: false
@nbeuchat nbeuchat added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Dec 7, 2020
@sara-tagger
Copy link
Collaborator

Thanks for raising this issue, @tttthomasssss will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗

@Rmsharks4
Copy link

Facing an error thats kind of like this - instead of 'str', i'm getting the error of type dict - I use a program to construct our training data from the database, and it looks the same as RASA's so idk what this error is about.

Command: rasa train

C:\Users\rsiddiqui\Anaconda3\envs\newenv\python.exe "F:\Users\rsiddiqui\AppData\Local\JetBrains\PyCharm 2019.3.4\plugins\python\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 54380 --file "C:/Users/rsiddiqui/Documents/Dialogue State Tracking/Annotations/models/RASAModel.py"
pydev debugger: process 2708 is connecting

Connected to pydev debugger (build 193.6911.25)
The configuration for policies was chosen automatically. It was written into the config file at 'C:/Users/rsiddiqui/Documents/Dialogue State Tracking/Annotations/dum/config.yaml'.
Traceback (most recent call last):
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\utils\validation.py", line 160, in validate_yaml_schema
    c.validate(raise_exception=True)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\pykwalify\core.py", line 167, in validate
    error_msg=u'.\n - '.join(self.validation_errors)))
pykwalify.errors.SchemaError: <SchemaError: error code 2: Schema validation failed:
 - Value '[ordereddict([('Client Name', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Direct Express'])]))]), ordereddict([('CSR Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Card Status', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Active'])]))]), ordereddict([('Payee Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('CH Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Last 4 Digits of Card', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Date of Birth', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Last 4 Digits of SSN', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Mobile Phone Number', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Phone Number Type', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Home Phone Number', 'Mobile Phone Number'])]))]), ordereddict([('Email', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Statement Medium', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Email'])]))]), ordereddict([('Statement Fees', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['No Money'])]))]), ordereddict([('Statement Frequency', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Monthly'])]))])]' is not a dict. Value path: '/slots'.
 - Value '[ordereddict([('Auto-Pop Opening_01128c5a-060e-4bf3-8a82-03658ed3e85a', ['Thank you for calling', 'thank you for calling', 'thanks <eps> for calling', 'thank <eps> for calling', 'thanks you for calling'])]), ordereddict([('Auto-Pop Opening_36d90f95-d4fa-4040-ba91-73f13977f6d1', ['Direct Express card services. This is {CSR Name}, How may I help you today?', 'thank you for S. R. services my name is fifty how may I help you', 'thank you for US start services my name is fifteen how may I help you', 'thank you for a R. services my name is Stephanie how may I help you', 'thank you for US start services my name is Stephanie how may I help you'])]), ordereddict([('Welcome Script v1.0_b6113477-a4fe-4847-bc64-bdb218419f67', ['I would first like to take a minute to share some important information', 'we need to go over some additional information with you', 'we need to go over some additional information would do', 'we need to go over some additional information with do'])]), ordereddict([('None', ['Not Found'])])]' is not a dict. Value path: '/responses'.: Path: '/'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\train.py", line 95, in train_async
    domain = await file_importer.get_domain()
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\utils\common.py", line 117, in decorated
    return await cache.cached_result()
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\importer.py", line 441, in get_domain
    self.importer.get_domain(), self._get_domain_with_e2e_actions()
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\importer.py", line 447, in _get_domain_with_e2e_actions
    stories = await self.get_stories()
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\importer.py", line 473, in get_stories
    template_variables, use_e2e, exclusion_percentage
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\importer.py", line 396, in get_stories
    template_variables, use_e2e, exclusion_percentage
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\utils\common.py", line 117, in decorated
    return await cache.cached_result()
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\importer.py", line 280, in get_stories
    stories = await asyncio.gather(*stories)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\rasa.py", line 51, in get_stories
    await self.get_domain(),
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\importers\rasa.py", line 67, in get_domain
    domain = Domain.load(self._domain_path)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\core\domain.py", line 123, in load
    other = cls.from_path(path)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\core\domain.py", line 133, in from_path
    domain = cls.from_file(path)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\core\domain.py", line 146, in from_file
    return cls.from_yaml(rasa.shared.utils.io.read_file(path), path)
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\core\domain.py", line 164, in from_yaml
    raise e
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\core\domain.py", line 152, in from_yaml
    yaml, rasa.shared.constants.DOMAIN_SCHEMA_FILE
  File "C:\Users\rsiddiqui\Anaconda3\envs\newenv\lib\site-packages\rasa\shared\utils\validation.py", line 167, in validate_yaml_schema
    content=source_data,
rasa.shared.utils.validation.YamlValidationException: Failed to validate 'C:\Users\rsiddiqui\Documents\Dialogue State Tracking\Annotations\domain.yaml'. Please make sure the file is correct and all mandatory parameters are specified. Here are the errors found during validation:
  in C:\Users\rsiddiqui\Documents\Dialogue State Tracking\Annotations\domain.yaml:69:
      Value '[ordereddict([('Client Name', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Direct Express'])]))]), ordereddict([('CSR Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Card Status', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Active'])]))]), ordereddict([('Payee Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('CH Name', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Last 4 Digits of Card', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Date of Birth', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Last 4 Digits of SSN', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Mobile Phone Number', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Phone Number Type', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Home Phone Number', 'Mobile Phone Number'])]))]), ordereddict([('Email', ordereddict([('auto_fill', False), ('type', 'any')]))]), ordereddict([('Statement Medium', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Email'])]))]), ordereddict([('Statement Fees', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['No Money'])]))]), ordereddict([('Statement Frequency', ordereddict([('auto_fill', False), ('type', 'categorical'), ('values', ['Monthly'])]))])]' is not a dict. Value path: '/slots'
  in C:\Users\rsiddiqui\Documents\Dialogue State Tracking\Annotations\domain.yaml:125:
      Value '[ordereddict([('Auto-Pop Opening_01128c5a-060e-4bf3-8a82-03658ed3e85a', ['Thank you for calling', 'thank you for calling', 'thanks <eps> for calling', 'thank <eps> for calling', 'thanks you for calling'])]), ordereddict([('Auto-Pop Opening_36d90f95-d4fa-4040-ba91-73f13977f6d1', ['Direct Express card services. This is {CSR Name}, How may I help you today?', 'thank you for S. R. services my name is fifty how may I help you', 'thank you for US start services my name is fifteen how may I help you', 'thank you for a R. services my name is Stephanie how may I help you', 'thank you for US start services my name is Stephanie how may I help you'])]), ordereddict([('Welcome Script v1.0_b6113477-a4fe-4847-bc64-bdb218419f67', ['I would first like to take a minute to share some important information', 'we need to go over some additional information with you', 'we need to go over some additional information would do', 'we need to go over some additional information with do'])]), ordereddict([('None', ['Not Found'])])]' is not a dict. Value path: '/responses'

@wochinge wochinge added area:rasa-oss/training-data Issues focused around Rasa training data (stories, NLU, domain, etc.) priority:high labels Jan 29, 2021
@TyDunn TyDunn added the feature:ux-cli+training-data Feature: Improve user experience with Rasa CLI and training data for developers label Feb 17, 2021
@joejuzl joejuzl added the effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. label Feb 26, 2021
@Imod7 Imod7 self-assigned this Mar 4, 2021
@Imod7 Imod7 linked a pull request Mar 9, 2021 that will close this issue
4 tasks
@Imod7 Imod7 added this to the 2.4 Rasa Open Source milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/training-data Issues focused around Rasa training data (stories, NLU, domain, etc.) effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. feature:ux-cli+training-data Feature: Improve user experience with Rasa CLI and training data for developers type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants