Fix polyglot HTTP 403 error in wordsteam.py - Replace with NLTK stemmers#62
Open
jalajthanaki wants to merge 2 commits intomasterfrom
Open
Fix polyglot HTTP 403 error in wordsteam.py - Replace with NLTK stemmers#62jalajthanaki wants to merge 2 commits intomasterfrom
jalajthanaki wants to merge 2 commits intomasterfrom
Conversation
- Remove broken polyglot dependency (server permanently down) - Replace with NLTK stemmers (SnowballStemmer, LancasterStemmer) - Update Python 2 print statements to Python 3 syntax - Add comprehensive documentation and migration guide - Add comparison table showing all three stemming algorithms - Tested and verified working solution Fixes the HTTP 403 Forbidden error that occurs when polyglot attempts to download morfessor models from the defunct server at polyglot.cs.stonybrook.edu Co-Authored-By: jalajthanaki@gmail.com <jalajthanaki@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: jalajthanaki@gmail.com <jalajthanaki@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix polyglot HTTP 403 error in wordsteam.py - Replace with NLTK stemmers
Summary
This PR fixes the critical issue where
3_1_wordsteam.pyfails withHTTP Error 403: Forbiddenwhen attempting to use the polyglot library. The polyglot data server (polyglot.cs.stonybrook.edu) is permanently down, making the library unusable.Changes made:
polyglot_stem()function withalternative_stemmers()using NLTK's SnowballStemmer and LancasterStemmerResult: The script now runs successfully without errors and provides enhanced educational value by comparing multiple stemming algorithms.
Review & Testing Checklist for Human
python3 ch3/3_1_wordsteam.pyto verify it works correctly and produces meaningful outputTest Plan:
Notes
Important semantic difference: This PR replaces polyglot's morpheme analysis with NLTK stemming. While related, stemming is a simpler operation than morphological decomposition. However, given that polyglot is permanently broken (server down since ~2018), this is the best available alternative that maintains the educational objectives of understanding word structure.
The documentation files provide migration guidance for users who have existing polyglot code and explain why this change was necessary.
Link to Devin run: https://app.devin.ai/sessions/5b232592eb644fcba8d24c926d47500a
Requested by: jalajthanaki@gmail.com (@jalajthanaki)