mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Add stub of tests for spancat
This commit is contained in:
parent
bf7c7c9ce2
commit
307c5cd6fd
25
spacy/tests/pipeline/test_spancat.py
Normal file
25
spacy/tests/pipeline/test_spancat.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user