mirror of https://github.com/explosion/spaCy.git
* Fix cost calculation on non-monotonic oracle
This commit is contained in:
parent
377a624046
commit
1f1532142f
|
@ -186,7 +186,7 @@ cdef class LeftArc:
|
||||||
for i in range(1, s.stack_depth()):
|
for i in range(1, s.stack_depth()):
|
||||||
cost += gold.heads[s.S(i)] == s.S(0)
|
cost += gold.heads[s.S(i)] == s.S(0)
|
||||||
cost += gold.heads[s.S(0)] == s.S(i)
|
cost += gold.heads[s.S(0)] == s.S(i)
|
||||||
return pop_cost(s, gold, s.S(0)) + arc_cost(s, gold, s.B(0), s.S(0))
|
return cost + pop_cost(s, gold, s.S(0)) + arc_cost(s, gold, s.B(0), s.S(0))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
cdef inline weight_t label_cost(StateClass s, const GoldParseC* gold, int label) nogil:
|
cdef inline weight_t label_cost(StateClass s, const GoldParseC* gold, int label) nogil:
|
||||||
|
|
Loading…
Reference in New Issue