Fix missing imports

This commit is contained in:
Ines Montani 2020-08-09 22:28:29 +02:00
parent 0fc13b2f14
commit 7c6854d8d4
2 changed files with 7 additions and 2 deletions

View File

@ -1,8 +1,9 @@
# cython: infer_types=True, profile=True, binding=True
from typing import List
import numpy
import srsly
from thinc.api import Model, set_dropout_rate, SequenceCategoricalCrossentropy, Config
from thinc.types import Floats2d
import warnings
from ..tokens.doc cimport Doc

View File

@ -1,5 +1,6 @@
from typing import Iterable, Tuple, Optional, Dict, List, Callable, Iterator, Any
from thinc.api import get_array_module, Model, Optimizer, set_dropout_rate, Config
from thinc.types import Floats2d
import numpy
from .pipe import Pipe
@ -69,7 +70,10 @@ subword_features = true
default_score_weights={"cats_score": 1.0},
)
def make_textcat(
nlp: Language, name: str, model: Model[List[Doc], List[Floats2d]], labels: Iterable[str]
nlp: Language,
name: str,
model: Model[List[Doc], List[Floats2d]],
labels: Iterable[str],
) -> "TextCategorizer":
"""Create a TextCategorizer compoment. The text categorizer predicts categories
over a whole document. It can learn one or more labels, and the labels can