Add test for serialization issue raised in #1105

This commit is contained in:
Matthew Honnibal 2017-10-10 03:57:58 +02:00
parent d8a2506023
commit f0f2739ae3
1 changed files with 9 additions and 0 deletions

View File

@ -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()