Skip to content

Instantly share code, notes, and snippets.

@diyclassics
Created December 16, 2016 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diyclassics/b24fbd1ad3bbb726387de443fab84956 to your computer and use it in GitHub Desktop.
Save diyclassics/b24fbd1ad3bbb726387de443fab84956 to your computer and use it in GitHub Desktop.
Backoff lemmatizer edits
def _define_lemmatizer(self):
backoff0 = None
backoff1 = IdentityLemmatizer()
backoff2 = TrainLemmatizer(model=self.LATIN_OLD_MODEL, backoff=backoff1)
backoff3 = PPLemmatizer(regexps=self.latin_verb_patterns, pps=self.latin_pps, backoff=backoff2)
backoff4 = UnigramLemmatizer(self.train_sents, backoff=backoff3)
backoff5 = RegexpLemmatizer(self.latin_misc_patterns, backoff=backoff4)
backoff6 = TrainLemmatizer(model=self.LATIN_MODEL, backoff=backoff5)
#backoff7 = BigramPOSLemmatizer(self.pos_train_sents, include=['cum'], backoff=backoff6)
lemmatizer = backoff6
return lemmatizer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment