Example #1
0
def test_determine_token_labels_with_extractors():
    determine_token_labels(CH_correct_segmentation[0],
                           [CH_correct_entity, CH_wrong_entity], ["A", "B"])
Example #2
0
def test_determine_token_labels_throws_error():
    with pytest.raises(ValueError):
        determine_token_labels(CH_correct_segmentation,
                               [CH_correct_entity,
                                CH_wrong_entity], ["CRFEntityExtractor"])
Example #3
0
def test_determine_token_labels_no_extractors():
    determine_token_labels(CH_correct_segmentation[0],
                           [CH_correct_entity, CH_wrong_entity], None)
Example #4
0
def test_determine_token_labels_no_extractors_no_overlap():
    determine_token_labels(CH_correct_segmentation[0], EN_targets, None)
Example #5
0
def test_determine_token_labels_with_extractors():
    determine_token_labels(
        CH_correct_segmentation[0], [CH_correct_entity, CH_wrong_entity],
        [SpacyEntityExtractor.name, MitieEntityExtractor.name])
Example #6
0
def test_determine_token_labels_no_extractors():
    with pytest.raises(ValueError):
        determine_token_labels(CH_correct_segmentation[0],
                               [CH_correct_entity, CH_wrong_entity], None)
Example #7
0
def test_determine_token_labels_with_extractors():
    determine_token_labels(CH_correct_segmentation[0],
                           [CH_correct_entity, CH_wrong_entity],
                           [SpacyEntityExtractor.name,
                            MitieEntityExtractor.name])
Example #8
0
def test_determine_token_labels_no_extractors_no_overlap():
    determine_token_labels(CH_correct_segmentation[0],
                           EN_targets, None)
Example #9
0
def test_determine_token_labels_no_extractors():
    with pytest.raises(ValueError):
        determine_token_labels(CH_correct_segmentation[0],
                               [CH_correct_entity, CH_wrong_entity], None)
Example #10
0
def test_determine_token_labels_throws_error():
    with pytest.raises(ValueError):
        determine_token_labels(CH_correct_segmentation[0],
                               [CH_correct_entity,
                                CH_wrong_entity], ["CRFEntityExtractor"])