mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
* Update for faster beam training
This commit is contained in:
parent
f8843906ad
commit
079dad28a7
|
@ -43,6 +43,8 @@ cdef class TransitionSystem:
|
||||||
|
|
||||||
cdef int set_valid(self, bint* output, const State* state) except -1
|
cdef int set_valid(self, bint* output, const State* state) except -1
|
||||||
|
|
||||||
|
cdef int set_costs(self, int* output, const State* state, GoldParse gold) except -1
|
||||||
|
|
||||||
cdef Transition best_valid(self, const weight_t* scores, const State* state) except *
|
cdef Transition best_valid(self, const weight_t* scores, const State* state) except *
|
||||||
|
|
||||||
cdef Transition best_gold(self, const weight_t* scores, const State* state,
|
cdef Transition best_gold(self, const weight_t* scores, const State* state,
|
||||||
|
|
|
@ -48,6 +48,11 @@ cdef class TransitionSystem:
|
||||||
cdef int set_valid(self, bint* output, const State* state) except -1:
|
cdef int set_valid(self, bint* output, const State* state) except -1:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
cdef int set_costs(self, int* output, const State* s, GoldParse gold) except -1:
|
||||||
|
cdef int i
|
||||||
|
for i in range(self.n_moves):
|
||||||
|
output[i] = self.c[i].get_cost(&self.c[i], s, &gold.c)
|
||||||
|
|
||||||
cdef Transition best_gold(self, const weight_t* scores, const State* s,
|
cdef Transition best_gold(self, const weight_t* scores, const State* s,
|
||||||
GoldParse gold) except *:
|
GoldParse gold) except *:
|
||||||
cdef Transition best
|
cdef Transition best
|
||||||
|
|
Loading…
Reference in New Issue
Block a user