mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
return on empty doc
This commit is contained in:
parent
7eb1cd100b
commit
1c60384bed
|
@ -6,6 +6,8 @@ from ...symbols import NOUN, PROPN, PRON, VERB, AUX
|
||||||
|
|
||||||
def noun_chunks(obj):
|
def noun_chunks(obj):
|
||||||
doc = obj.doc
|
doc = obj.doc
|
||||||
|
if not len(doc):
|
||||||
|
return
|
||||||
np_label = doc.vocab.strings.add('NP')
|
np_label = doc.vocab.strings.add('NP')
|
||||||
left_labels = ['det', 'fixed', 'neg'] #['nunmod', 'det', 'appos', 'fixed']
|
left_labels = ['det', 'fixed', 'neg'] #['nunmod', 'det', 'appos', 'fixed']
|
||||||
right_labels = ['flat', 'fixed', 'compound', 'neg']
|
right_labels = ['flat', 'fixed', 'compound', 'neg']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user