liveBook · Manning

Part-of-speech tagging

As explained in Natural Language Processing in Action, Second Edition

Part-of-speech tagging assigns grammatical word categories such as noun, verb, or adjective to tokens in text.

Part-of-speech tagging assigns grammatical categories to tokens, such as nouns, verbs, adjectives, and punctuation. In a chatbot pipeline, it generates features during text analysis, helping later stages interpret what words are doing. section 1.9

The tags support information extraction by distinguishing likely entities from relations: people, places, and things are often nouns or proper nouns, while verbs can connect entities in a knowledge graph. POS tagging also supports dependency parsing. section 11.4.2

Inspecting tags with spaCy

After processing text with nlp(text), iterate through the first sentence and print each token with its coarse POS category: 'born_VERB ... computer_NOUN scientist_NOUN ... works_VERB ...'. For a tabular inspection, collect TOK, POS, TAG, ENT_TYPE, DEP, and token children in a pandas DataFrame.

Figure 1.8 Example layers for an NLP pipeline
figure

Use the NLP pipeline layers to place POS tagging within feature extraction, feature analysis, entity relationships, and knowledge-base construction. section 1.9

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains coarse and fine-grained tags, inspects spaCy annotations, and identifies finite-state tagging without deriving its algorithms.
Examples
Uses spaCy token listings, tag explanations, entity annotations, dependency fields, and pandas tables built from a biography passage.
What you can do after
Apply it via spaCy to inspect grammatical categories, detailed tags, entities, and dependencies for each token.
How it connects
Connects POS tagging to feature extraction, named entity recognition, dependency parsing, knowledge graphs, and chatbot pipelines.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.