Make example Python 2 compatible (see #1617)

This commit is contained in:
ines 2017-11-20 13:57:51 +01:00
parent 4f7e64e371
commit 1a38575de3

View File

@ -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 = []