mutators
Mutate spaCy
tokens.
This module contains functions that assist with mutating spaCy
tokens.
A typical usage example
import spacy
from spacy_cleaner import processing
nlp = spacy.load("en_core_web_md")
doc = nlp("swimming")
tok = doc[0]
processing.mutate_lemma_toke(tok)
swimming
is swim
.
mutate_lemma_token(tok)
¶
Mutate a token to its lemma.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tok |
Token
|
tokens.Token |
required |
Returns:
Type | Description |
---|---|
str
|
The lemma of the token. |