mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Fix lightning tour example (closes #889)
This commit is contained in:
parent
e7ae3b7cc2
commit
c6c3162c50
|
@ -137,7 +137,7 @@ p
|
||||||
return word.ent_type != 0
|
return word.ent_type != 0
|
||||||
|
|
||||||
def count_parent_verb_by_person(docs):
|
def count_parent_verb_by_person(docs):
|
||||||
counts = defaultdict(defaultdict(int))
|
counts = defaultdict(lambda: defaultdict(int))
|
||||||
for doc in docs:
|
for doc in docs:
|
||||||
for ent in doc.ents:
|
for ent in doc.ents:
|
||||||
if ent.label_ == 'PERSON' and ent.root.head.pos == VERB:
|
if ent.label_ == 'PERSON' and ent.root.head.pos == VERB:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user