From f0f2739ae3348f22d948351cdb143b14e6557056 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 10 Oct 2017 03:57:58 +0200 Subject: [PATCH] Add test for serialization issue raised in #1105 --- spacy/tests/serialize/test_serialize_empty_model.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spacy/tests/serialize/test_serialize_empty_model.py diff --git a/spacy/tests/serialize/test_serialize_empty_model.py b/spacy/tests/serialize/test_serialize_empty_model.py new file mode 100644 index 00000000000..b614a3648d1 --- /dev/null +++ b/spacy/tests/serialize/test_serialize_empty_model.py @@ -0,0 +1,9 @@ +import spacy +import spacy.lang.en +from spacy.pipeline import TextCategorizer + +def test_bytes_serialize_issue_1105(): + nlp = spacy.lang.en.English() + tokenizer = nlp.tokenizer + textcat = TextCategorizer(tokenizer.vocab, labels=['ENTITY', 'ACTION', 'MODIFIER']) + textcat_bytes = textcat.to_bytes()