コード例 #1
0
def test_evaluate_entities_cv_empty_tokens():
    mock_extractors = ["A", "B"]
    result = align_entity_predictions(EN_targets, EN_predicted,
                                      [], mock_extractors)

    assert result == {
        "target_labels": [],
        "extractor_labels": {
            "A": [],
            "B": []
        }
    }, "Wrong entity prediction alignment"
コード例 #2
0
ファイル: test_evaluation.py プロジェクト: marami52/rasa_nlu
def test_evaluate_entities_cv_empty_tokens():
    mock_extractors = ["A", "B"]
    result = align_entity_predictions(EN_targets, EN_predicted,
                                      [], mock_extractors)

    assert result == {
        "target_labels": [],
        "extractor_labels": {
            "A": [],
            "B": []
        }
    }, "Wrong entity prediction alignment"
コード例 #3
0
def test_evaluate_entities_cv():
    mock_extractors = ["A", "B"]
    result = align_entity_predictions(EN_targets, EN_predicted,
                                      EN_tokens, mock_extractors)

    assert result == {
        "target_labels": ["O", "O", "O", "O", "O", "O", "O", "O", "food",
                          "location", "location", "datetime"],
        "extractor_labels": {
            "A": ["O", "person", "O", "O", "O", "O", "O", "O", "food",
                  "O", "location", "O"],
            "B": ["O", "O", "O", "O", "O", "O", "O", "O", "O", "O",
                  "movie", "movie"]
        }
    }, "Wrong entity prediction alignment"
コード例 #4
0
ファイル: test_evaluation.py プロジェクト: marami52/rasa_nlu
def test_evaluate_entities_cv():
    mock_extractors = ["A", "B"]
    result = align_entity_predictions(EN_targets, EN_predicted,
                                      EN_tokens, mock_extractors)

    assert result == {
        "target_labels": ["O", "O", "O", "O", "O", "O", "O", "O", "food",
                          "location", "location", "datetime"],
        "extractor_labels": {
            "A": ["O", "person", "O", "O", "O", "O", "O", "O", "food",
                  "O", "location", "O"],
            "B": ["O", "O", "O", "O", "O", "O", "O", "O", "O", "O",
                  "movie", "movie"]
        }
    }, "Wrong entity prediction alignment"