# What can be done so that 'teacher' and 'teaches' are treated similar?

Who teaches English?


Now, after tokenizing, stemming.. it gives me

Who, teach, English


In my list of word, I have a word called

teacher


Lemmatizing, stemming teacher gives teacher and lemmatizing, stemming teaches gives teach

Even, calculating edit_distance will not solve this.. As, edit_distance comes out to be 2.

Now, What do I do to have teacher and teach treated as similar? Similarly, there may be other cases with extra 's' at the end. Is there some stemmer that solves this problem? Is there any solution?

Other similar example can be: instructor and instructs

## 2 Answers

Use an aggressive stemmer. The Lancaster Stemmer is one the most aggressive and popular stemmers around.

Here is the Python code:

from nltk.stem.lancaster import LancasterStemmer

lancaster_stemmer = LancasterStemmer()
assert 'teach' == lancaster_stemmer.stem('teacher') == lancaster_stemmer.stem('teaches')


Check out Fasttext. Fasttext works similarly to word2vec in that you can create word embeddings, however, it actually analyzes character n-grams, to force the syntactic similarity to what you're thinking about.

• I tried using fasttext. But, found some problem. @j.a.gartner, Could you please see this query Jun 30 '17 at 2:17
• It is now solved! Jun 30 '17 at 11:16
• Sorry, didn't see until you had already solved it. Jun 30 '17 at 15:06