From 42526a6fa1ca358eb8c1b1af1f98a5b80ed1838f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Wed, 22 Jun 2022 17:05:34 +0200 Subject: [PATCH] Make Doc.activations type visible to MyPy --- spacy/tokens/doc.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/tokens/doc.pyi b/spacy/tokens/doc.pyi index a40fa74aa..ec0bd8534 100644 --- a/spacy/tokens/doc.pyi +++ b/spacy/tokens/doc.pyi @@ -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]]