determining the word types determining the word types is what part of speech (postagging is all about pos tagger parses full sentence with the goal to arrange it into dependence treewhere each node corresponds to word and the parent-child relationship determines which word it depends on with this treeit can then make more informed decisionsfor examplewhether the word "bookis noun ("this is good book "or verb ("could you please book the flight?"you might have already guessed that nltk will also play role also in this area and indeedit comes readily packaged with all sorts of parsers and taggers the pos tagger we will usenltk pos_tag()is actually full-blown classifier trained using manually annotated sentences from the penn treebank project (upenn edu/~treebankit takes as input list of word tokens and outputs list of tupleseach element of which contains the part of the original sentence and its part of speech tagimport nltk nltk pos_tag(nltk word_tokenize("this is good book ")[('this''dt')('is''vbz')(' ''dt')('good''jj')('book''nn')('')nltk pos_tag(nltk word_tokenize("could you please book the flight?")[('could''md')('you''prp')('please''vb')('book''nn')('the''dt')('flight''nn')('?'')the pos tag abbreviations are taken from the penn treebank project (adapted from pos tag description example cc coordinating conjunction or cd cardinal number second dt determiner the ex existential there there are fw foreign word kindergarten in preposition/subordinating conjunction onoflike jj adjective cool jjr adjectivecomparative cooler jjs adjectivesuperlative coolest ls list marker md modal couldwill