Skip to content

Commit

Permalink
fix test_nlu_comparison() test
Browse files Browse the repository at this point in the history
  • Loading branch information
m-vdb committed Apr 3, 2020
1 parent 175d266 commit 63bf1e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions tests/nlu/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ def config_path() -> Text:
).name


@pytest.fixture(scope="session")
def config_path_duplicate() -> Text:
return write_file_config(
{
"language": "en",
"pipeline": [
{"name": "WhitespaceTokenizer"},
{"name": "CRFEntityExtractor", EPOCHS: 1, RANDOM_SEED: 42},
{"name": "CountVectorsFeaturizer"},
{"name": "EmbeddingIntentClassifier", EPOCHS: 1, RANDOM_SEED: 42},
],
}
).name


@pytest.fixture()
def pretrained_embeddings_spacy_config() -> RasaNLUModelConfig:
return RasaNLUModelConfig(
Expand Down
6 changes: 4 additions & 2 deletions tests/nlu/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,10 @@ def test_get_evaluation_metrics(
assert NO_ENTITY not in report


def test_nlu_comparison(tmpdir, config_path):
configs = [config_path, config_path]
def test_nlu_comparison(tmpdir, config_path, config_path_duplicate):
# the configs need to be at a different path, otherwise the results are
# combined on the same dictionary key and cannot be plotted properly
configs = [config_path, config_path_duplicate]

output = tmpdir.strpath
compare_nlu_models(
Expand Down

0 comments on commit 63bf1e0

Please sign in to comment.