mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-10 15:14: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:
|
||||
if tag is None:
|
||||
correct[idx] = guesses[idx]
|
||||
elif isinstance(tag, list): # Leave these latent for now.
|
||||
correct[idx] = guesses[idx]
|
||||
else:
|
||||
correct[idx] = tag_index[tag]
|
||||
idx += 1
|
||||
|
|
|
@ -479,6 +479,10 @@ cdef class ArcEager(TransitionSystem):
|
|||
if head is None or dep is None:
|
||||
gold.c.heads[i] = i
|
||||
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:
|
||||
if head > i:
|
||||
action = LEFT
|
||||
|
|
|
@ -111,7 +111,10 @@ cdef class BiluoPushDown(TransitionSystem):
|
|||
if not self.has_gold(gold):
|
||||
return None
|
||||
for i in range(gold.length):
|
||||
gold.c.ner[i] = self.lookup_transition(gold.ner[i])
|
||||
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])
|
||||
return gold
|
||||
|
||||
def get_beam_annot(self, Beam beam):
|
||||
|
|
Loading…
Reference in New Issue
Block a user