Challenge: Applying Part-of-Speech Tagging

Implement POS tagging into the rule-based grammar corrector.

We'll cover the following

During the implementation of creating rule-based grammar objects, there were multiple instances where we needed to create POS tags for our sentences. There may also be instances where multiple sentences of input text are passed into our grammar corrector.

Tasks

In this lesson, we will use what was learned in the POS tagging section to implement two functions.

  • In the split_text_into_sentences() function, simply take in a body of text and split on punctuation.

  • In the create_pos_tags() function, split a sentence into its POS tags using either methodology (HMM, Perceptron) learned in the POS tagging section.

The only rule is that it must return valid tags from the Penn Treebank. Please try to implement what you can from memory and only look back if you need assistance.

Get hands-on with 1400+ tech skills courses.