I’ve got some results with:
import logging
import asyncio
from rasa.validator import Validator
from rasa.importers.rasa import RasaFileImporter
file_importer = RasaFileImporter.load_from_config(
'config.yml', 'domain.yml', ['data/nlu.md', 'data/stories.md']
)
loop = asyncio.get_event_loop()
domain = loop.run_until_complete(file_importer.get_domain())
nlu_data = loop.run_until_complete(file_importer.get_nlu_data())
story_graph = loop.run_until_complete(file_importer.get_stories())
logfile = './nlu_model.log'
logging.basicConfig(filename=logfile, level=logging.DEBUG)
validator = Validator(domain, nlu_data, story_graph.story_steps)
validator.verify_intents()
validator.verify_utterances()
validator.verify_example_repetition_in_intents()
#validator.verify_story_structure(max_history=5)
#validator.verify_utterances_in_stories()
#validator.verify_nlu()
#validator.verify_intents_in_stories()
But the last four methods generate those errors.
validator.verify_story_structure(max_history=5)
Traceback (most recent call last):
File "poc.py", line 23, in <module>
validator.verify_story_structure(max_history=5)
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/validator.py", line 223, in verify_story_structure
augmentation_factor=0,
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/core/training/generator.py", line 167, in __init__
self.story_graph = story_graph.with_cycles_removed()
AttributeError: 'list' object has no attribute 'with_cycles_removed'
validator.verify_utterances_in_stories()
Traceback (most recent call last):
File "poc.py", line 22, in <module>
validator.verify_utterances_in_stories()
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/validator.py", line 173, in verify_utterances_in_stories
for story in self.story_graph.story_steps:
AttributeError: 'list' object has no attribute 'story_steps'
validator.verify_nlu()
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/validator.py", line 243, in verify_nlu
intents_are_valid = self.verify_intents_in_stories(ignore_warnings)
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/validator.py", line 103, in verify_intents_in_stories
for story in self.story_graph.story_steps
AttributeError: 'list' object has no attribute 'story_steps'
validator.verify_intents_in_stories()
Traceback (most recent call last):
File "poc.py", line 25, in <module>
validator.verify_intents_in_stories()
File "/home/joseph/.venv/.py3env/lib/python3.6/site-packages/rasa/validator.py", line 103, in verify_intents_in_stories
for story in self.story_graph.story_steps
AttributeError: 'list' object has no attribute 'story_steps'