5651a0d052bcfd160b187828aa3d8d90652929fe,spacy/pipeline/functions.py,,merge_entities,#Any#,26

Before Change


    doc (Doc): The Doc object.
    RETURNS (Doc): The Doc object with merged noun entities.
    
    spans = [
        (e.start_char, e.end_char, e.root.tag, e.root.dep, e.label) for e in doc.ents
    ]
    for start, end, tag, dep, ent_type in spans:
        doc.merge(start, end, tag=tag, dep=dep, ent_type=ent_type)
    return doc


def merge_subtokens(doc, label="subtok"):

After Change


    doc (Doc): The Doc object.
    RETURNS (Doc): The Doc object with merged noun entities.
    
    with doc.retokenize() as retokenizer:
        for ent in doc.ents:
            attrs = {"tag": ent.root.tag, "dep": ent.root.dep, "ent_type": ent.label}
            retokenizer.merge(ent, attrs=attrs)
    return doc


def merge_subtokens(doc, label="subtok"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 21

Instances


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/pipeline/functions.py
Class Name:
Method Name: merge_entities


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/pipeline/functions.py
Class Name:
Method Name: merge_entities


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/tests/parser/test_parse.py
Class Name:
Method Name: test_parser_merge_pp


Project Name: explosion/spaCy
Commit Name: 5651a0d052bcfd160b187828aa3d8d90652929fe
Time: 2019-02-15
Author: ines@ines.io
File Name: spacy/pipeline/functions.py
Class Name:
Method Name: merge_noun_chunks