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

Fix for missing intent warnings when running rasa test #8388

Merged
merged 14 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/8388.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed bug where missing intent warnings appear when running `rasa test`
3 changes: 2 additions & 1 deletion rasa/cli/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
DEFAULT_MODELS_PATH,
DEFAULT_DATA_PATH,
DEFAULT_RESULTS_PATH,
DEFAULT_DOMAIN_PATH,
)
import rasa.shared.utils.validation as validation_utils
import rasa.cli.utils
Expand Down Expand Up @@ -158,7 +159,7 @@ async def run_nlu_test_async(

data_path = rasa.cli.utils.get_validated_path(data_path, "nlu", DEFAULT_DATA_PATH)
test_data_importer = TrainingDataImporter.load_from_dict(
training_data_paths=[data_path]
training_data_paths=[data_path], domain_path=DEFAULT_DOMAIN_PATH,
)
nlu_data = await test_data_importer.get_nlu_data()

Expand Down
13 changes: 12 additions & 1 deletion rasa/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,20 @@ async def _create_data_generator(
use_conversation_test_files: bool = False,
) -> "TrainingDataGenerator":
from rasa.shared.core.generator import TrainingDataGenerator
from rasa.shared.constants import DEFAULT_DOMAIN_PATH
from rasa.model import get_model_subdirectories

core_model = None
if agent.model_directory:
core_model, _ = get_model_subdirectories(agent.model_directory)

if core_model and os.path.exists(os.path.join(core_model, DEFAULT_DOMAIN_PATH)):
domain_path = os.path.join(core_model, DEFAULT_DOMAIN_PATH)
else:
domain_path = None

test_data_importer = TrainingDataImporter.load_from_dict(
training_data_paths=[resource_name]
training_data_paths=[resource_name], domain_path=domain_path
b-quachtran marked this conversation as resolved.
Show resolved Hide resolved
)
if use_conversation_test_files:
story_graph = await test_data_importer.get_conversation_tests()
Expand Down
3 changes: 2 additions & 1 deletion rasa/nlu/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,13 +1439,14 @@ async def run_evaluation(
Returns: dictionary containing evaluation results
"""
import rasa.shared.nlu.training_data.loading
from rasa.shared.constants import DEFAULT_DOMAIN_PATH

# get the metadata config from the package data
interpreter = Interpreter.load(model_path, component_builder)

interpreter.pipeline = remove_pretrained_extractors(interpreter.pipeline)
test_data_importer = TrainingDataImporter.load_from_dict(
training_data_paths=[data_path]
training_data_paths=[data_path], domain_path=DEFAULT_DOMAIN_PATH,
)
test_data = await test_data_importer.get_nlu_data()

Expand Down