Customizing lemmatization
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
import spacy | |
nlp = spacy.load('en_core_web_md') | |
nlp.get_pipe('attribute_ruler').add([[{"TEXT":"Angeltown"}]],{"LEMMA":"San Fransisco"}) | |
doc = nlp(u'I am flying to Angeltown') | |
for token in doc: | |
print(token.text, token.lemma_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment