# Part-of-speech tagging (POS tagging)

> Canonical: https://skillalmanac.com/glossary/part-of-speech-tagging | Last verified: 2026-11-25 | Index status: index-eligible

Part-of-speech tagging is the task of labelling each word in a text with its grammatical category, such as noun, verb or adjective. A program that does this is called a POS tagger.

Also called: POS tagging, POS tagger, part-of-speech tagger, POS-tagging, grammatical tagging.

## In plain language

In school you may have labelled the words of a sentence as nouns, verbs and adjectives. Part-of-speech tagging asks a program to do the same for every word in a text. The labels help other programs that analyse language, for example to find the action in a sentence or to tell apart 'record' as a thing and 'record' as something you do. The hard part is that many words can be several things depending on the sentence, and a tagger assigns a tag to each word, per the NLTK book. It will make mistakes, especially on slang, typos or specialist text it was not built for.

## Technical definition

POS tagging is a sequence-labelling task: given a sequence of tokens, assign one tag from a tagset to each. NLTK describes a tagger as processing a sequence of words and attaching a part-of-speech tag to each word, and it represents a tagged token as a (token, tag) pair. Tagsets differ; Universal Dependencies defines 17 UPOS tags for core categories such as NOUN, VERB and ADJ. NLTK also notes that corpora can be mapped to a built-in mapping to the Universal Tagset. A tagger assigns a tag to each word, per the NLTK book, so output depends on the tagset and on the kind of text it is applied to.

## How it shows up when you use agents

Part-of-speech tagging is a classic step in [natural language processing](/glossary/natural-language-processing), and you are unlikely to run it by hand inside Claude Code, Codex or Cursor. Tagging shows up instead in text-analysis scripts, search and indexing tools, and older language pipelines that an agent may help you write or debug, for example by calling NLTK.

What breaks when it is misunderstood: people treat tags as ground truth. A tagger gives its best guess for each word from a chosen tagset, so two libraries can label the same word differently because their tagsets differ. Mixing tags from different tagsets in one script can cause mistakes. Another risk is applying a tagger built for one kind of text to code comments, chat messages or legal clauses and trusting the output.

A next action: if you ask an agent to add tagging to a script, name the tagset you want, run it on a dozen real lines of your own text and read the tags before building on them. If you only need names, dates or addresses, [named entity recognition](/glossary/named-entity-recognition) or a pattern match is a better fit than a full tagging pass.

## Common confusions

- **POS tagging versus named entity recognition.** Tagging labels each word's grammatical role. Entity recognition finds spans that name people, places or organisations. See [Named entity recognition](/glossary/named-entity-recognition).
- **POS tagging versus parsing.** A tag says what category a word has. A parse also says how words relate to one another in the sentence.
- **Tagset versus tagger.** The tagset is the list of labels. The tagger is the program that assigns them. Changing one changes the output.
- **Myth.** A tag is a fact about the word. A tag is a label chosen from a tagset for that word in that sentence, and the same word can get different tags in different sentences.

## Worked examples in this catalogue

### [text-entity-extractor](https://skillalmanac.com/skills/skill-almanac/text-entity-extractor)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: URLs, hashtags, @mentions and dates pulled from one plain UTF-8 text file, with counts, the first line and every line number.

Why it exercises the concept: It finds items by their written pattern, not by grammar. It is a contrast case: a POS tagger assigns a grammatical label to every word, which pattern matching does not.

### [stock-phrase-scanner](https://skillalmanac.com/skills/skill-almanac/stock-phrase-scanner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A report of stock filler phrases, hedges and repeated sentence openers in a plain-text draft, with line numbers for each hit.

Why it exercises the concept: It matches listed phrases without labelling grammar. Seeing what such a scan cannot say about word roles shows what tagging adds.

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Metadata, rows, search and filters for Hugging Face datasets, read through the Dataset Viewer API.

Why it exercises the concept: This skill lets an agent look at the rows of such a dataset if you choose one.

## Related terms

- [Natural language processing (NLP)](https://skillalmanac.com/glossary/natural-language-processing.md)
- [Named entity recognition (NER)](https://skillalmanac.com/glossary/named-entity-recognition.md)
- [Token](https://skillalmanac.com/glossary/token.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)
- [BERT](https://skillalmanac.com/glossary/bert.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)

## Sources

- [Categorizing and Tagging Words](https://www.nltk.org/book/ch05.html), NLTK Book (accessed 2026-11-24)
- [Universal POS tags](https://universaldependencies.org/u/pos/), Universal Dependencies (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
