This commit is contained in:
saidbleik 2020-01-18 18:07:39 +00:00
Родитель ea11200338
Коммит 4b2ced52ba
1 изменённых файлов: 1 добавлений и 11 удалений

Просмотреть файл

@ -1,18 +1,8 @@
# Copyright (c) Microsoft Corporation. All rights reserved. # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. # Licensed under the MIT License.
import pytest
from utils_nlp.common.pytorch_utils import dataloader_from_dataset from utils_nlp.common.pytorch_utils import dataloader_from_dataset
from utils_nlp.models.transformers.named_entity_recognition import ( from utils_nlp.models.transformers.named_entity_recognition import TokenClassificationProcessor, TokenClassifier
TokenClassificationProcessor,
TokenClassifier,
)
def test_token_classifier_num_labels():
with pytest.raises(ValueError):
TokenClassifier(num_labels=1)
def test_token_classifier_fit_predict(tmp_path, ner_test_data): def test_token_classifier_fit_predict(tmp_path, ner_test_data):