Make Doc.activations type visible to MyPy

This commit is contained in:
Daniël de Kok 2022-06-22 17:05:34 +02:00
parent acf47e8e48
commit 42526a6fa1

View File

@ -1,7 +1,7 @@
from typing import Callable, Protocol, Iterable, Iterator, Optional
from typing import Union, Tuple, List, Dict, Any, overload
from cymem.cymem import Pool
from thinc.types import Floats1d, Floats2d, Ints2d
from thinc.types import ArrayXd, Floats1d, Floats2d, Ints2d
from .span import Span
from .token import Token
from ._dict_proxies import SpanGroups
@ -22,6 +22,7 @@ class Doc:
max_length: int
length: int
sentiment: float
activations: Dict[str, Dict[str, ArrayXd]]
cats: Dict[str, float]
user_hooks: Dict[str, Callable[..., Any]]
user_token_hooks: Dict[str, Callable[..., Any]]