-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Filter - Use ISO language in StopwordsFilter #1024
Merged
Merged
Conversation
This file contains 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
PrimozGodec
force-pushed
the
language-filter
branch
from
November 17, 2023 10:17
bab6863
to
53c0467
Compare
PrimozGodec
force-pushed
the
language-filter
branch
from
November 17, 2023 13:09
53c0467
to
d4588b3
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1024 +/- ##
==========================================
+ Coverage 82.10% 82.19% +0.08%
==========================================
Files 93 93
Lines 12257 12292 +35
Branches 1660 1668 +8
==========================================
+ Hits 10064 10103 +39
+ Misses 1881 1879 -2
+ Partials 312 310 -2 |
PrimozGodec
changed the title
[ENH] Filter - language from corpus in StopwordsFilter
[ENH] Filter - Use ISO language in StopwordsFilter
Nov 17, 2023
PrimozGodec
force-pushed
the
language-filter
branch
from
November 17, 2023 15:02
7152459
to
3b5004f
Compare
VesnaT
requested changes
Nov 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the following error when opening an old workflow
----------------------------- KeyError Exception ------------------------------
Traceback (most recent call last):
File "/Users/vesna/orange-widget-base/orangewidget/settings.py", line 592, in _migrate_settings
self.widget_class.migrate_settings(
File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owpreprocess.py", line 1386, in migrate_settings
pp["language"] = StopwordsFilter.lang_to_iso(pp["language"])
File "/Users/vesna/orange3-text/orangecontrib/text/preprocess/filter.py", line 118, in lang_to_iso
return LANG2ISO[StopwordsFilter.NLTK2LANG.get(language, language)]
KeyError: 'it'
-------------------------------------------------------------------------------
VesnaT
approved these changes
Nov 24, 2023
3 tasks
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.
Issue
This PR is part of #963, which I am splitting into smaller pieces for easier review.
The main motivation behind this is to make Preprocess work with language from Corpus.
Description of changes
This PR prepare a stop word filter to communicate (get and return languages) as ISO codes, which is necessary to enable language from Corpus (languages are stored in Corpus in ISO format).
After I changed Stop Word to work with ISO language codes, I also had to adapt the Preprocess Widget to store settings as ISO codes and call the StopWords filter with ISO language code.
Includes