mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Update norms example
This commit is contained in:
parent
a857b2b511
commit
f8e93b6d0a
|
@ -349,10 +349,12 @@ p
|
||||||
| a token's norm equals its lowercase text. If the lowercase spelling of a
|
| a token's norm equals its lowercase text. If the lowercase spelling of a
|
||||||
| word exists, norms should always be in lowercase.
|
| word exists, norms should always be in lowercase.
|
||||||
|
|
||||||
+aside-code("Accessing norms").
|
+aside-code("Norms vs. lemmas").
|
||||||
doc = nlp(u"I'm gonna")
|
doc = nlp(u"I'm gonna")
|
||||||
norms = [token.norm_ for token in doc]
|
norms = [token.norm_ for token in doc]
|
||||||
|
lemmas = [token.lemma_ for token in doc]
|
||||||
assert norms == ['i', 'am', 'going', 'to']
|
assert norms == ['i', 'am', 'going', 'to']
|
||||||
|
assert lemmas == ['i', 'be', 'go', 'to']
|
||||||
|
|
||||||
p
|
p
|
||||||
| spaCy usually tries to normalise words with different spellings to a single,
|
| spaCy usually tries to normalise words with different spellings to a single,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user