diff --git a/examples/information_extraction/entity_relations.py b/examples/information_extraction/entity_relations.py index ef920ab00..3c3b8132f 100644 --- a/examples/information_extraction/entity_relations.py +++ b/examples/information_extraction/entity_relations.py @@ -36,7 +36,8 @@ def main(model='en_core_web_sm'): def extract_currency_relations(doc): # merge entities and noun chunks into one token - for span in [*list(doc.ents), *list(doc.noun_chunks)]: + spans = list(doc.ents) + list(doc.noun_chunks) + for span in spans: span.merge() relations = []