Add stub of tests for spancat

This commit is contained in:
Matthew Honnibal 2019-07-13 12:13:32 +02:00
parent bf7c7c9ce2
commit 307c5cd6fd

View File

@ -0,0 +1,25 @@
# coding: utf8
from __future__ import unicode_literals
import pytest
from spacy.tokens import Span
from spacy.language import Language
from spacy.pipeline.spancat import SpanCategorizer
def test_init_spancat(en_vocab):
model = SpanCategorizer(en_vocab)
@pytest.fixture
def spancat(en_vocab):
return SpanCategorizer(en_vocab)
def test_spancat_add_label(spancat):
assert "NP" not in spancat.labels
spancat.add_label("NP")
assert "NP" in spancat.labels
def test_spancat_init_model(spancat):
model = spancat.Model(10, width=10, embed_size=10)