nltk.tag.pos_tag_sents

nltk.tag.pos_tag_sents(sentences, tagset=None, lang='eng')[source]

Use NLTK’s currently recommended part of speech tagger to tag the given list of sentences, each consisting of a list of tokens.

Parameters
  • sentences (list(list(str))) – List of sentences to be tagged

  • tagset (str) – the tagset to be used, e.g. universal, wsj, brown

  • lang (str) – the ISO 639 code of the language, e.g. ‘eng’ for English, ‘rus’ for Russian

Returns

The list of tagged sentences

Return type

list(list(tuple(str, str)))