What Is Part-of-Speech Tagging?

Learn how part-of-speech tagging is used as a foundation to grammar correction.

Part-of-speech tagging, often abbreviated as POS tagging, is a fundamental NLP task that involves determining the grammatical category or part of speech of each word in a given text. The primary goal of POS tagging is to label each word with its corresponding part of speech, such as nouns, verbs, adjectives, etc., providing additional context for a word and its part within a sentence.

Naturally, POS tagging is a language-dependent task, and for English, a word will be categorized into one of the nine generally accepted parts of speech: nouns, pronouns, verbs, adverbs, adjectives, prepositions, conjunctions, numerals, and determiners (or articles).

Let's take an example sentence: "The cat sat on the mat." A POS tagger would analyze this sentence and label each word with its appropriate part of speech:

  • "The" → determiner (DET)

  • "cat" → noun (NOUN)

  • "sat" → verb (VERB)

  • "on" → preposition (PREP)

  • "the" → determiner (DET)

  • "mat" → noun (NOUN)

Relevance to grammar correction

POS tagging is highly relevant to grammar correction because it provides valuable information about the syntactic structure and relationships between words in a sentence. This information is crucial for identifying and rectifying grammatical errors in text. Here's how part of speech tagging contributes to grammar correction:

  • Error detection: POS tagging helps identify potential grammatical errors by highlighting inconsistencies or incorrect word usage based on the expected part of speech. For example, if a verb is used where a noun is expected, or if an adjective is used as a verb, the part of speech tagger can flag these instances as potential errors.

  • Subject-verb agreement: POS tagging assists in detecting subject-verb agreement errors. The tagger can compare the part of speech tags of the subject and the verb to ensure they match in terms of number (singular or plural) and person (first, second, or third). For example, saying “One of my friends likes to cook” is correct, whereas “like to cook” would be an error.

  • Pronoun-antecedent agreement: When dealing with pronouns, part of speech tagging helps ensure that pronouns and their antecedents (the words they refer to) agree in terms of number, gender, and person, for example, an error like "one items" may be identified by POS tagging.

  • Modifiers and adjectives: POS tagging helps identify misplaced or dangling modifiers, as well as incorrect adjective usage. It ensures that adjectives are appropriately placed before the nouns they modify. For example, if a sentence had 2 predicates, a POS tagger would recognize that pattern.

  • Verb tense and conjugation: POS tagging can detect errors related to verb tense and conjugation. It helps ensure that verbs are used in the correct tense and that they agree with the subject of the sentence. For instance, saying “Last year I am going to the mall” is incorrect; the correct past-tense form should be “went”.

  • Preposition usage: Incorrect use of prepositions can lead to awkward or ungrammatical sentences. Part of speech tagging can help detect cases where prepositions are used improperly or omitted. Generally, prepositions are not found next to each other, and that allows a POS tagger to find this error. For example, saying, “Amongst atop the mirror I left my wallet” is incorrect; the first “amongst” can be omitted.

  • Misused determiners: POS tagging can assist in identifying errors related to determiners (e.g., “a,” “an,” “the”). It ensures that the appropriate determiners are used based on the context. A simple example would be saying “a apple” instead of “an apple” or “an banana” instead of “a banana”.

  • Sentence structure: POS tagging contributes to identifying errors in sentence structure, such as run-on sentences or sentence fragments, by analyzing the relationship between words and their grammatical functions. An example may be saying, “I like. To go to the mall.” Clearly, in this sentence, the sentence fragments should be combined.

Other applications of POS tagging in NLP

This process is crucial in various NLP applications, including information retrieval and search, sentiment analysis, machine translation, information extraction, and text summarization. The ability to analyze the sentence structure of sentences is vital to ensuring that language models are outputting readable, syntactically correct, language.

Get hands-on with 1400+ tech skills courses.