mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Return None from parser if there are no annotations
This commit is contained in:
parent
8af3100143
commit
3d22fcaf0b
|
@ -432,6 +432,8 @@ cdef class Parser:
|
|||
0.0)
|
||||
todo = [(s, g) for (s, g) in zip(states, golds)
|
||||
if not s.is_final() and g is not None]
|
||||
if not todo:
|
||||
return None
|
||||
|
||||
backprops = []
|
||||
d_tokvecs = state2vec.ops.allocate(tokvecs.shape)
|
||||
|
|
Loading…
Reference in New Issue
Block a user