liveBook · Manning

spaCy

As explained in Starting Data Analytics with Generative AI and Python

spaCy is an open-source Python library for industrial-strength natural language processing.

spaCy is a Python library used here for lemmatization: reducing words to their base forms before keyword matching. This can make searches more consistent, but cleaning choices still depend on the dataset and task. section 5.5.5

Lemmatizing Portuguese reviews

Load the Portuguese model, process each review, collect token lemmas, and store the normalized text before searching keywords: nlp = spacy.load("pt_core_news_sm"); doc = nlp(text); lemmatized_words = [token.lemma_ for token in doc]. Inspect the resulting matches rather than assuming preprocessing improves every measure. section 5.5.5

Dedicated libraries can provide more consistent and scalable text analysis than generative AI, especially for specialized vocabulary, ambiguous language, and repeatable detection tasks. section 5.1.3

How Starting Data Analytics with Generative AI and Python covers it

How deep it goes
Demonstrates a concrete preprocessing function but stops short of explaining spaCy internals or comparing model quality.
Examples
Uses Portuguese customer reviews, the pt_core_news_sm model, and cleaned_review_text as concrete artifacts.
What it assumes
Assumes basic Python and dataframe familiarity while demonstrating the lemmatization workflow directly.
What you can do after
Apply spaCy to lemmatize review text and prepare it for keyword matching.
How it connects
Connects lemmatization with keyword search, text cleaning, NLTK, stemming, and generative AI.

Also explained in

Compare how 5 books explain spaCy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Starting Data Analytics with Generative AI and Python. The section links point to the parts of the book it draws on.