From 581bda9f985eba04e01c69c2c2f0a978ae6e6684 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 21 May 2020 20:17:14 +0200 Subject: [PATCH] Update senter test and auto-format --- spacy/tests/pipeline/test_senter.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/spacy/tests/pipeline/test_senter.py b/spacy/tests/pipeline/test_senter.py index 197fdca6e..041da2c9f 100644 --- a/spacy/tests/pipeline/test_senter.py +++ b/spacy/tests/pipeline/test_senter.py @@ -12,14 +12,21 @@ def test_label_types(): with pytest.raises(NotImplementedError): nlp.get_pipe("senter").add_label("A") + SENT_STARTS = [0] * 14 SENT_STARTS[0] = 1 SENT_STARTS[5] = 1 SENT_STARTS[9] = 1 TRAIN_DATA = [ - ("I like green eggs. Eat blue ham. I like purple eggs.", {"sent_starts": SENT_STARTS}), - ("She likes purple eggs. They hate ham. You like yellow eggs.", {"sent_starts": SENT_STARTS}), + ( + "I like green eggs. Eat blue ham. I like purple eggs.", + {"sent_starts": SENT_STARTS}, + ), + ( + "She likes purple eggs. They hate ham. You like yellow eggs.", + {"sent_starts": SENT_STARTS}, + ), ] @@ -36,7 +43,7 @@ def test_overfitting_IO(): assert losses["senter"] < 0.001 # test the trained model - test_text = "I like purple eggs. They eat ham. You like yellow eggs." + test_text = TRAIN_DATA[0][0] doc = nlp(test_text) gold_sent_starts = [0] * 14 gold_sent_starts[0] = 1