Skip to content

Sync nlp-sentiment-analysis with the updated tutorial - #959

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/sentiment-analysis-python-20261201
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/sentiment-analysis-python-20261201

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Maintenance sync for Use Sentiment Analysis With Python to Classify Movie Reviews.

What changed

  • requirements.txt: spacy==2.3.9 (final 2.x release, has CPython 3.10/3.11 wheels), plus numpy==1.26.4 and setuptools==80.10.2, because spaCy 2's compiled thinc 7 breaks on NumPy 2 and spaCy 2 imports pkg_resources, which setuptools 81+ no longer ships. pandas moved from 1.1.2 (no wheels for current Python) to 2.3.3. Matches the article draft's dependencies field.
  • README.md: python -m spacy download en_core_web_sm fails on current pip (it rejects the egg fragment spaCy 2 generates), so the model is installed directly from its GitHub release, the same command the article now shows. The tutorial link now points at the current slug.

Verification
Fresh Python 3.11.18 venv: python -m pip install -r requirements.txt, the README model install, then MPLBACKEND=Agg python sentiment_analyzer.py against the Large Movie Review Dataset: 20 training iterations and a prediction, exit 0. ruff@0.14.1 format --check and ruff check pass.

🤖 Generated with Claude Code

…ent Analysis With Python to Classify Movie Reviews

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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