mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-13 16:44:56 +03:00
Handle list-valued GoldParse values
This commit is contained in:
parent
29b77fd0eb
commit
2d929ffc5d
|
@ -500,6 +500,8 @@ class Tagger(Pipe):
|
||||||
for tag in gold.tags:
|
for tag in gold.tags:
|
||||||
if tag is None:
|
if tag is None:
|
||||||
correct[idx] = guesses[idx]
|
correct[idx] = guesses[idx]
|
||||||
|
elif isinstance(tag, list): # Leave these latent for now.
|
||||||
|
correct[idx] = guesses[idx]
|
||||||
else:
|
else:
|
||||||
correct[idx] = tag_index[tag]
|
correct[idx] = tag_index[tag]
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
|
@ -479,6 +479,10 @@ cdef class ArcEager(TransitionSystem):
|
||||||
if head is None or dep is None:
|
if head is None or dep is None:
|
||||||
gold.c.heads[i] = i
|
gold.c.heads[i] = i
|
||||||
gold.c.has_dep[i] = False
|
gold.c.has_dep[i] = False
|
||||||
|
elif isinstance(head, list):
|
||||||
|
# TODO: This is where the fused token stuff will happen
|
||||||
|
gold.c.heads[i] = i
|
||||||
|
gold.c.has_dep[i] = False
|
||||||
else:
|
else:
|
||||||
if head > i:
|
if head > i:
|
||||||
action = LEFT
|
action = LEFT
|
||||||
|
|
|
@ -111,6 +111,9 @@ cdef class BiluoPushDown(TransitionSystem):
|
||||||
if not self.has_gold(gold):
|
if not self.has_gold(gold):
|
||||||
return None
|
return None
|
||||||
for i in range(gold.length):
|
for i in range(gold.length):
|
||||||
|
if isinstance(gold.ner[i], list):
|
||||||
|
gold.c.ner[i] = self.lookup_transition(None)
|
||||||
|
else:
|
||||||
gold.c.ner[i] = self.lookup_transition(gold.ner[i])
|
gold.c.ner[i] = self.lookup_transition(gold.ner[i])
|
||||||
return gold
|
return gold
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user