From a2357cce3fdf38382fcce783b13132f4d473ddfd Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 23 Sep 2017 02:57:31 +0200 Subject: [PATCH] Set random seed in train script --- spacy/cli/train.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/cli/train.py b/spacy/cli/train.py index c87aabb01..3551c4f2c 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -11,6 +11,8 @@ import tqdm from thinc.neural._classes.model import Model from thinc.neural.optimizers import linear_decay from timeit import default_timer as timer +import random +import numpy.random from ..tokens.doc import Doc from ..scorer import Scorer @@ -21,6 +23,9 @@ from .. import util from .. import displacy from ..compat import json_dumps +random.seed(0) +numpy.random.seed(0) + @plac.annotations( lang=("model language", "positional", None, str),