Refer to correct object

This commit is contained in:
Ines Montani 2020-05-21 14:20:29 +02:00
parent b1f45c9da3
commit e2fe83e35d
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ def noun_chunks(doclike):
np_right_deps = [doc.vocab.strings.add(label) for label in right_labels] np_right_deps = [doc.vocab.strings.add(label) for label in right_labels]
stop_deps = [doc.vocab.strings.add(label) for label in stop_labels] stop_deps = [doc.vocab.strings.add(label) for label in stop_labels]
token = doc[0] token = doc[0]
while token and token.i < len(doc): while token and token.i < len(doclike):
if token.pos in [PROPN, NOUN, PRON]: if token.pos in [PROPN, NOUN, PRON]:
left, right = noun_bounds( left, right = noun_bounds(
doc, token, np_left_deps, np_right_deps, stop_deps doc, token, np_left_deps, np_right_deps, stop_deps