def test_duckling_patching():
    entities = [[{
        "start": 37,
        "end": 56,
        "value": "near Alexanderplatz",
        "entity": "location",
        "extractor": "ner_crf"
    }, {
        "start": 57,
        "end": 64,
        "value": "tonight",
        "entity": "Time",
        "extractor": "ner_duckling"
    }]]
    patched = [[{
        "start": 37,
        "end": 56,
        "value": "near Alexanderplatz",
        "entity": "location",
        "extractor": "ner_crf"
    }, {
        "start": 57,
        "end": 64,
        "value": "tonight",
        "entity": "Time",
        "extractor": "ner_duckling (Time)"
    }]]
    assert patch_duckling_entities(entities) == patched
Exemple #2
0
def test_duckling_patching():
    entities = [[
        {
            "start": 37,
            "end": 56,
            "value": "near Alexanderplatz",
            "entity": "location",
            "extractor": "ner_crf"
        },
        {
            "start": 57,
            "end": 64,
            "value": "tonight",
            "entity": "Time",
            "extractor": "ner_duckling"

        }
    ]]
    patched = [[
        {
            "start": 37,
            "end": 56,
            "value": "near Alexanderplatz",
            "entity": "location",
            "extractor": "ner_crf"
        },
        {
            "start": 57,
            "end": 64,
            "value": "tonight",
            "entity": "Time",
            "extractor": "ner_duckling (Time)"

        }
    ]]
    assert patch_duckling_entities(entities) == patched