spaCy/website/docs/api
adrianeboyd 2c876eb672 Add tokenizer explain() debugging method (#4596)
* Expose tokenizer rules as a property

Expose the tokenizer rules property in the same way as the other core
properties. (The cache resetting is overkill, but consistent with
`from_bytes` for now.)

Add tests and update Tokenizer API docs.

* Update Hungarian punctuation to remove empty string

Update Hungarian punctuation definitions so that `_units` does not match
an empty string.

* Use _load_special_tokenization consistently

Use `_load_special_tokenization()` and have it to handle `None` checks.

* Fix precedence of `token_match` vs. special cases

Remove `token_match` check from `_split_affixes()` so that special cases
have precedence over `token_match`. `token_match` is checked only before
infixes are split.

* Add `make_debug_doc()` to the Tokenizer

Add `make_debug_doc()` to the Tokenizer as a working implementation of
the pseudo-code in the docs.

Add a test (marked as slow) that checks that `nlp.tokenizer()` and
`nlp.tokenizer.make_debug_doc()` return the same non-whitespace tokens
for all languages that have `examples.sentences` that can be imported.

* Update tokenization usage docs

Update pseudo-code and algorithm description to correspond to
`nlp.tokenizer.make_debug_doc()` with example debugging usage.

Add more examples for customizing tokenizers while preserving the
existing defaults.

Minor edits / clarifications.

* Revert "Update Hungarian punctuation to remove empty string"

This reverts commit f0a577f7a5.

* Rework `make_debug_doc()` as `explain()`

Rework `make_debug_doc()` as `explain()`, which returns a list of
`(pattern_string, token_string)` tuples rather than a non-standard
`Doc`. Update docs and tests accordingly, leaving the visualization for
future work.

* Handle cases with bad tokenizer patterns

Detect when tokenizer patterns match empty prefixes and suffixes so that
`explain()` does not hang on bad patterns.

* Remove unused displacy image

* Add tokenizer.explain() to usage docs
2019-11-20 13:07:25 +01:00
..
annotation.md Update tag maps and docs for English and German (#4501) 2019-10-24 12:56:05 +02:00
cli.md Support Mish activation (requires Thinc 7.3) (#4536) 2019-10-28 15:16:33 +01:00
cython-classes.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
cython-structs.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
cython.md 💫 Update website (#3285) 2019-02-17 19:31:19 +01:00
dependencyparser.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
doc.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
docbin.md Fix DocBin.merge() example (#4599) 2019-11-07 11:26:48 +01:00
entitylinker.md Fix typos and formatting [ci skip] 2019-10-01 12:30:04 +02:00
entityrecognizer.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
entityruler.md Update new version identifier [ci skip] 2019-10-25 11:42:49 +02:00
goldcorpus.md 💫 Update website (#3285) 2019-02-17 19:31:19 +01:00
goldparse.md Fix documentation for the docs_to_json function (#4456) 2019-10-16 23:17:58 +02:00
index.md 💫 Update website (#3285) 2019-02-17 19:31:19 +01:00
kb.md Use consistent spelling 2019-10-02 10:37:39 +02:00
language.md Also support passing list to Language.disable_pipes (#4521) 2019-10-25 16:19:08 +02:00
lemmatizer.md Misspelling on Lemmatizer Example #4406 (#4449) 2019-10-16 23:23:15 +02:00
lexeme.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
lookups.md Fix typos and formatting [ci skip] 2019-10-01 12:30:04 +02:00
matcher.md Implement new API for {Phrase}Matcher.add (backwards-compatible) (#4522) 2019-10-25 22:21:08 +02:00
phrasematcher.md Implement new API for {Phrase}Matcher.add (backwards-compatible) (#4522) 2019-10-25 22:21:08 +02:00
pipeline-functions.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
scorer.md Add textcat to train CLI (#4226) 2019-09-15 22:31:31 +02:00
sentencizer.md Fix assert in sentencizer documentation. (#4639) 2019-11-13 15:24:14 +01:00
span.md Merge branch 'master' into develop 2019-09-12 18:03:01 +02:00
stringstore.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
tagger.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
textcategorizer.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
token.md Remove u-strings and fix formatting [ci skip] 2019-09-12 16:11:15 +02:00
tokenizer.md Add tokenizer explain() debugging method (#4596) 2019-11-20 13:07:25 +01:00
top-level.md Remove LEMMA from exception examples [ci skip] 2019-09-12 16:26:27 +02:00
vectors.md Add docs for Vectors.most_similar [ci skip] 2019-10-03 14:29:47 +02:00
vocab.md Fix formatting [ci skip] 2019-10-21 12:26:07 +02:00