def test_run_cv_evaluation():
    td = training_data.load_data('data/examples/rasa/demo-rasa.json')
    nlu_config = config.load('sample_configs/config_spacy.yml')
    n_folds = 2
    (results, entity_results) = run_cv_evaluation(td, n_folds, nlu_config)
    assert (len(results.train['Accuracy']) == n_folds)
    assert (len(results.train['Precision']) == n_folds)
    assert (len(results.train['F1-score']) == n_folds)
    assert (len(results.test['Accuracy']) == n_folds)
    assert (len(results.test['Precision']) == n_folds)
    assert (len(results.test['F1-score']) == n_folds)
    assert (len(entity_results.train['ner_crf']['Accuracy']) == n_folds)
    assert (len(entity_results.train['ner_crf']['Precision']) == n_folds)
    assert (len(entity_results.train['ner_crf']['F1-score']) == n_folds)
    assert (len(entity_results.test['ner_crf']['Accuracy']) == n_folds)
    assert (len(entity_results.test['ner_crf']['Precision']) == n_folds)
    assert (len(entity_results.test['ner_crf']['F1-score']) == n_folds)
def test_run_cv_evaluation():
    td = training_data.load_data('data/examples/rasa/demo-rasa.json')
    nlu_config = config.load('sample_configs/config_spacy.yml')
    n_folds = 2
    (results, entity_results) = run_cv_evaluation(td, n_folds, nlu_config)
    assert (len(results.train['Accuracy']) == n_folds)
    assert (len(results.train['Precision']) == n_folds)
    assert (len(results.train['F1-score']) == n_folds)
    assert (len(results.test['Accuracy']) == n_folds)
    assert (len(results.test['Precision']) == n_folds)
    assert (len(results.test['F1-score']) == n_folds)
    assert (len(entity_results.train['ner_crf']['Accuracy']) == n_folds)
    assert (len(entity_results.train['ner_crf']['Precision']) == n_folds)
    assert (len(entity_results.train['ner_crf']['F1-score']) == n_folds)
    assert (len(entity_results.test['ner_crf']['Accuracy']) == n_folds)
    assert (len(entity_results.test['ner_crf']['Precision']) == n_folds)
    assert (len(entity_results.test['ner_crf']['F1-score']) == n_folds)