-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Implement shrink_windows
argument for Word2Vec.
#3169
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6afb3ff
Implemented `reduced_windows` argument for Word2Vec.
pandrey-fr 9bdb5a1
Improve the way `reduced_windows` is passed around and used.
pandrey-fr 77698cd
Renamed `reduced_windows` to `shrink_windows`.
pandrey-fr 11a464f
Removed `shrink_windows` argument from `Word2Vec.train`.
pandrey-fr 7b6e73a
Merge branch 'develop' into fixed-winsize
M-Demay a657518
Aesthetic fix.
pandrey-fr ff0d30e
Fixed old word2vec models' reloading.
pandrey-fr f98eb43
Fixed undue docstring.
pandrey-fr 3b27f1c
Added `shrink_windows` argument to Doc2Vec.
pandrey-fr 27a49d7
Added `shrink_windows` argument to FastText.
pandrey-fr 6fde7e8
Fixed and optimized `shrink_windows` backend use.
pandrey-fr 486b3f5
Added tests for `shrink_windows=False` in Word2Vec-based models.
pandrey-fr f0af84e
Added docstring mentions of `shrink_window` being experimental.
pandrey-fr 49cf50e
Rolled back some purely aesthetic changes.
pandrey-fr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added tests for
shrink_windows=False
in Word2Vec-based models.
- Loading branch information
commit 486b3f502e45b4bc06bf1a9196c9de41587478b1
There are no files selected for viewing
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
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
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
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.
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.
https://docs.pytest.org/en/6.2.x/example/parametrize.html
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 pushed two commits making use of that feature. The first one only applied to the FastText tests, as they were the one you attached this review to. The second one applies to the other two test sets (wor2vec and doc2vec); if you feel like the latter should not have been changed, we can discard this commit.
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.
Update: actually,
pytest.mark.parametrize
does not work as expected on methods (although it does on functions). I will try to find a way to make it work, otherwise I will undo the last two commits.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.
Oh, in fact it probably will not work due to the test classes being
unittest.TestCase
subclasses.https://docs.pytest.org/en/6.2.x/unittest.html
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 am revoking the last two commits as a consequence.
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.
Thanks for pointing that out. I didn't know pytest parameterization is incompatible with unittest.TestCase.
Luckily, in this particular case, the unittest.TestCase class isn't doing anything. I'll get parameterization working in a separate commit.
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.
Well, we both learned something :)