Skip to content

Sync spacy with the updated tutorial - #969

Merged
realpython-bot merged 2 commits into
masterfrom
maintenance/natural-language-processing-spacy-python-20261201
Dec 1, 2026
Merged

realpython-bot merged 2 commits into
masterfrom
maintenance/natural-language-processing-spacy-python-20261201

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Syncs the spacy/ folder with the maintenance update of Natural Language Processing With spaCy in Python.

What changed

  • requirements.txt: re-pinned to the article's dependencies (spaCy 3.8.18, textacy 0.12.0, en_core_web_sm 3.8.0, Python 3.13). The old file pinned spaCy 3.4.4 and its 2022 dependency set.
  • examples.py: matches the updated article's code:
    • the phone-number pattern ends in {"SHAPE": "dddd"} and creates its Matcher inside the function. The old ddd never matched 7891 and returned None.
    • matcher.add() uses the list-of-patterns signature. extract_full_name() yields, and you call it with next().
    • custom_about_text, about_talk_text, the POS loop, the noun/adjective split, and the NER spacy.explain() line match the article.
    • read_text(encoding="utf-8").
  • introduction.txt: now reads spaCy and ends with a newline, which gives the '\n' token the article shows.
  • README.md: added Setup (Python 3.12 or later, pinned install) and Usage sections.

Verification

  • Clean Python 3.13 venv from requirements.txt. Ran examples.py end to end with displacy.serve()/render() stubbed, and every printed result matches the article's output. The stop-word sample is the exception because set order is random.
  • ruff 0.14.1 format --check and ruff check pass, and so does dircheck.py.

Draft: https://realpython.com/pbjt/blog/post/2610/change/
Card: https://trello.com/c/gS76u4kR

🤖 Generated with Claude Code

realpython-bot and others added 2 commits December 1, 2026 12:39
Pin spaCy 3.8.18, textacy 0.12.0, and en_core_web_sm 3.8.0 on Python 3.13,
match examples.py to the updated article's code, and add Setup and Usage
sections to the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realpython-bot
realpython-bot merged commit d9b2cb7 into master Dec 1, 2026
1 check passed
@realpython-bot
realpython-bot deleted the maintenance/natural-language-processing-spacy-python-20261201 branch December 1, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant