mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-13 01:32:32 +03:00
Fix GoldParse argument to tagger.update
This commit is contained in:
parent
274a4d4272
commit
195d998a12
|
@ -211,6 +211,8 @@ cdef class Tagger:
|
||||||
def update(self, Doc tokens, object gold):
|
def update(self, Doc tokens, object gold):
|
||||||
if hasattr(gold, 'tags'):
|
if hasattr(gold, 'tags'):
|
||||||
gold_tag_strs = list(gold.tags)
|
gold_tag_strs = list(gold.tags)
|
||||||
|
else:
|
||||||
|
gold_tag_strs = gold
|
||||||
assert len(tokens) == len(gold_tag_strs)
|
assert len(tokens) == len(gold_tag_strs)
|
||||||
for tag in gold_tag_strs:
|
for tag in gold_tag_strs:
|
||||||
if tag != None and tag not in self.tag_names:
|
if tag != None and tag not in self.tag_names:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user