custom tokenizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doc = nlp("gimme that book") | |
print([w.text for w in doc]) | |
from spacy.symbols import ORTH | |
special_case = [{ORTH: "gim"}, {ORTH: "me"}] | |
nlp.tokenizer.add_special_case("gimme", special_case) | |
print([w.text for w in doc]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment