Fix lightning tour example (closes #889)

This commit is contained in:
ines 2017-04-17 00:00:27 +02:00
parent e7ae3b7cc2
commit c6c3162c50

View File

@ -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: