From 98165e43a7f38f2719310324a90f5dcfd3e00ca7 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 1 Apr 2018 08:44:35 +0000 Subject: [PATCH] Sometimes update beam with greedy oracle --- spacy/syntax/nn_parser.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 7e55a668d..7030d9a3b 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -552,7 +552,7 @@ cdef class Parser: if not any(self.moves.has_gold(gold) for gold in golds): return None 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, self.cfg['beam_width'], self.cfg['beam_density'], drop=drop, sgd=sgd, losses=losses)