From 1a38575de3df79530e752f9489bdae94c810cd14 Mon Sep 17 00:00:00 2001 From: ines Date: Mon, 20 Nov 2017 13:57:51 +0100 Subject: [PATCH] Make example Python 2 compatible (see #1617) --- examples/information_extraction/entity_relations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = []