I am trying to get 1,2,3 gram suffix for a word and use them as features in my model.
Example,
word = "Apple"
1 gram suffix = 'e'
2 gram suffix = 'le'
3 gram suffix = 'ple'
I have used CountVectorizer in sklearn with ngram_range=(1,3) but that gives all the n grams. I just need the n gram suffixes.
How can I do that?
Also, I'm new to NLP and have no clue how to use these n grams as features in my ML model. How can I convert these "string" n-gram features to some sort of numeric representation so that I can use them in my model.
Can someone please help me out?