mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 02:06:31 +03:00
Decrease beam density, and fix Python 3 problem in beam
This commit is contained in:
parent
82a4ee6c47
commit
b487b8735a
|
@ -70,7 +70,7 @@ def get_templates(name):
|
|||
|
||||
|
||||
cdef int BEAM_WIDTH = 16
|
||||
cdef weight_t BEAM_DENSITY = 0.01
|
||||
cdef weight_t BEAM_DENSITY = 0.001
|
||||
|
||||
cdef class BeamParser(Parser):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -136,7 +136,8 @@ cdef class BeamParser(Parser):
|
|||
self.model.update_from_histories(self.moves, tokens, [(0.0, [])])
|
||||
elif True:
|
||||
#_check_train_integrity(pred, gold, gold_parse, self.moves)
|
||||
histories = zip(violn.p_probs, violn.p_hist) + zip(violn.g_probs, violn.g_hist)
|
||||
histories = list(zip(violn.p_probs, violn.p_hist)) + \
|
||||
list(zip(violn.g_probs, violn.g_hist))
|
||||
self.model.update_from_histories(self.moves, tokens, histories, min_grad=0.001**(itn+1))
|
||||
else:
|
||||
self.model.update_from_histories(self.moves, tokens,
|
||||
|
|
Loading…
Reference in New Issue
Block a user