mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Make example Python 2 compatible (see #1617)
This commit is contained in:
parent
4f7e64e371
commit
1a38575de3
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user