mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-29 18:54:07 +03:00
Sometimes update beam with greedy oracle
This commit is contained in:
parent
6efb76bb3f
commit
98165e43a7
|
@ -552,7 +552,7 @@ cdef class Parser:
|
||||||
if not any(self.moves.has_gold(gold) for gold in golds):
|
if not any(self.moves.has_gold(gold) for gold in golds):
|
||||||
return None
|
return None
|
||||||
assert len(docs) == len(golds)
|
assert len(docs) == len(golds)
|
||||||
if self.cfg.get('beam_width', 1) >= 2 and numpy.random.random() >= 0.0:
|
if self.cfg.get('beam_width', 1) >= 2 and numpy.random.random() >= 0.5:
|
||||||
return self.update_beam(docs, golds,
|
return self.update_beam(docs, golds,
|
||||||
self.cfg['beam_width'], self.cfg['beam_density'],
|
self.cfg['beam_width'], self.cfg['beam_density'],
|
||||||
drop=drop, sgd=sgd, losses=losses)
|
drop=drop, sgd=sgd, losses=losses)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user