There are some words which are used sometimes as a verb and sometimes as other part of speech.
Example
A sentence with the meaning of the w
In python it is done as:
from nltk import pos_tag s1 = "I blame myself for what happened" pos_tag(s1.split())
It will give you words with there tags