From c0eaba8b28613241819ec3280526e3d2e64e2e7e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 2 Sep 2017 15:17:32 +0200 Subject: [PATCH] Fix low-data textcat --- spacy/_ml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index 1cd83563e..ffa2951ce 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -517,7 +517,9 @@ def build_text_classifier(nr_class, width=64, **cfg): model = ( SpacyVectors >> flatten_add_lengths - >> with_getitem(0, LN(Affine(width, 300))) + >> with_getitem(0, + Affine(width, 300) + ) >> ParametricAttention(width) >> Pooling(sum_pool) >> Residual(ReLu(width, width)) ** 2