The module NLTK can automatically tag speech. Given a sentence or paragraph, it can label words such as verbs, nouns and so on.
NLTK - speech tagging example
The example below automatically tags words with a corresponding class.
import nltk from nltk.tokenize import PunktSentenceTokenizer
document = 'Whether you\'re new to programming or an experienced developer, it\'s easy to learn and use Python.' sentences = nltk.sent_tokenize(document) for sent in sentences: print(nltk.pos_tag(nltk.word_tokenize(sent)))