Commit Graph

9 Commits

Author SHA1 Message Date
Daniël de Kok
8c2652d788 Remove TrainablePipe.activations
We do not need to enumerate the activations anymore since `store_activations` is
`bool`.
2022-08-29 16:47:13 +02:00
Daniël de Kok
aea53378dc Make the TrainablePipe.store_activations property a bool
This means that we can also bring back `store_activations` setter.
2022-08-29 16:41:11 +02:00
Daniël de Kok
230264daa0 Revert "Use dict comprehension suggested by @svlandeg"
This reverts commit 6e7b958f70.
2022-08-05 10:33:20 +02:00
Daniël de Kok
6e7b958f70 Use dict comprehension suggested by @svlandeg 2022-08-04 17:13:52 +02:00
Daniël de Kok
51f72e41ec Replace store_activations setter by set_store_activations method
Setters that take a different type than what the getter returns are still
problematic for MyPy. Replace the setter by a method, so that type inference
works everywhere.
2022-08-04 15:14:22 +02:00
Daniël de Kok
403b1f1312 Add store_activations to docstrings. 2022-07-06 16:15:13 +02:00
Daniël de Kok
1c9be0d8ab trainable_lemmatizer/entity_linker: add store_activations option 2022-06-23 15:47:00 +02:00
Richard Hudson
32954c3bcb
Fix issues for Mypy 0.950 and Pydantic 1.9.0 (#10786)
* Make changes to typing

* Correction

* Format with black

* Corrections based on review

* Bumped Thinc dependency version

* Bumped blis requirement

* Correction for older Python versions

* Update spacy/ml/models/textcat.py

Co-authored-by: Daniël de Kok <me@github.danieldk.eu>

* Corrections based on review feedback

* Readd deleted docstring line

Co-authored-by: Daniël de Kok <me@github.danieldk.eu>
2022-05-25 09:33:54 +02:00
Adriane Boyd
85778dfcf4
Add edit tree lemmatizer (#10231)
* Add edit tree lemmatizer

Co-authored-by: Daniël de Kok <me@danieldk.eu>

* Hide edit tree lemmatizer labels

* Use relative imports

* Switch to single quotes in error message

* Type annotation fixes

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Reformat edit_tree_lemmatizer with black

* EditTreeLemmatizer.predict: take Iterable

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Validate edit trees during deserialization

This change also changes the serialized representation. Rather than
mirroring the deep C structure, we use a simple flat union of the match
and substitution node types.

* Move edit_trees to _edit_tree_internals

* Fix invalid edit tree format error message

* edit_tree_lemmatizer: remove outdated TODO comment

* Rename factory name to trainable_lemmatizer

* Ignore type instead of casting truths to List[Union[Ints1d, Floats2d, List[int], List[str]]] for thinc v8.0.14

* Switch to Tagger.v2

* Add documentation for EditTreeLemmatizer

* docs: Fix 3.2 -> 3.3 somewhere

* trainable_lemmatizer documentation fixes

* docs: EditTreeLemmatizer is in edit_tree_lemmatizer.py

Co-authored-by: Daniël de Kok <me@danieldk.eu>
Co-authored-by: Daniël de Kok <me@github.danieldk.eu>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2022-03-28 11:13:50 +02:00