mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Add warnings example in v2.3 migration guide (#5627)
This commit is contained in:
parent
150a39ccca
commit
bc1cb30b21
|
@ -161,10 +161,18 @@ debugging your tokenizer configuration.
|
||||||
|
|
||||||
spaCy's custom warnings have been replaced with native Python
|
spaCy's custom warnings have been replaced with native Python
|
||||||
[`warnings`](https://docs.python.org/3/library/warnings.html). Instead of
|
[`warnings`](https://docs.python.org/3/library/warnings.html). Instead of
|
||||||
setting `SPACY_WARNING_IGNORE`, use the
|
setting `SPACY_WARNING_IGNORE`, use the [`warnings`
|
||||||
[`warnings` filters](https://docs.python.org/3/library/warnings.html#the-warnings-filter)
|
filters](https://docs.python.org/3/library/warnings.html#the-warnings-filter)
|
||||||
to manage warnings.
|
to manage warnings.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
import spacy
|
||||||
|
+ import warnings
|
||||||
|
|
||||||
|
- spacy.errors.SPACY_WARNING_IGNORE.append('W007')
|
||||||
|
+ warnings.filterwarnings("ignore", message=r"\[W007\]", category=UserWarning)
|
||||||
|
```
|
||||||
|
|
||||||
#### Normalization tables
|
#### Normalization tables
|
||||||
|
|
||||||
The normalization tables have moved from the language data in
|
The normalization tables have moved from the language data in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user