mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
* Update for faster beam training
This commit is contained in:
parent
f8843906ad
commit
079dad28a7
|
@ -42,6 +42,8 @@ cdef class TransitionSystem:
|
||||||
cdef Transition init_transition(self, int clas, int move, int label) except *
|
cdef Transition init_transition(self, int clas, int move, int label) except *
|
||||||
|
|
||||||
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 *
|
||||||
|
|
||||||
|
|
|
@ -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