From 4c5f265884776f7c643a2f37150f339a09549231 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 22 Mar 2019 16:10:11 +0100 Subject: [PATCH 1/2] Fix train loop for train_textcat example --- examples/training/train_textcat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/training/train_textcat.py b/examples/training/train_textcat.py index c678632cd..6745ddba6 100644 --- a/examples/training/train_textcat.py +++ b/examples/training/train_textcat.py @@ -73,10 +73,12 @@ def main(model=None, output_dir=None, n_iter=20, n_texts=2000, init_tok2vec=None textcat.model.tok2vec.from_bytes(file_.read()) print("Training the model...") print("{:^5}\t{:^5}\t{:^5}\t{:^5}".format("LOSS", "P", "R", "F")) + batch_sizes = compounding(4.0, 32.0, 1.001) for i in range(n_iter): losses = {} # batch up the examples using spaCy's minibatch - batches = minibatch(train_data, size=compounding(4.0, 32.0, 1.001)) + random.shuffle(train_data) + batches = minibatch(train_data, size=batch_sizes) for batch in batches: texts, annotations = zip(*batch) nlp.update(texts, annotations, sgd=optimizer, drop=0.2, losses=losses) From d8533f01494d46dac65661f516d41e6781f2bce4 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 22 Mar 2019 18:16:46 +0100 Subject: [PATCH 2/2] Update Binder [ci skip] --- website/meta/site.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/meta/site.json b/website/meta/site.json index 4defdf913..4323d7991 100644 --- a/website/meta/site.json +++ b/website/meta/site.json @@ -28,8 +28,8 @@ }, "spacyVersion": "2.1", "binderUrl": "ines/spacy-io-binder", - "binderBranch": "nightly", - "binderVersion": "2.1.0a9", + "binderBranch": "live", + "binderVersion": "2.1.2", "sections": [ { "id": "usage", "title": "Usage Documentation", "theme": "blue" }, { "id": "models", "title": "Models Documentation", "theme": "blue" },