-
-
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
Parallel scan_vocab #406
Closed
Closed
Parallel scan_vocab #406
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a67de48
Merge remote-tracking branch 'upstream/develop' into develop
b472166
'scan_vocab' now supports parallel execution, same implementation as …
178bb34
Added scan_size param. Replaced dicts by Counters for value merge. Ad…
2681c33
Check if sentences is a generator object/funct, and raise TypeError i…
05d6074
Minor code cleaning. Change check type from generator to tuple to sup…
d64d4b7
Fixed doc2vec class using word2vec's build_vocab, skipping its own sc…
dfb5b66
put copy of the work_vocab in the queue to prevent next work loop cle…
2eb8850
replaced Counter by defaultdict to get back Python2.6 compat
263002a
replaced generator syntax with for loop as it isn't supported by 2.6
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
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.
What is this for? Is it necessary?
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.
With the new logic in place, if sentences is a generator (which it shouldn't) it won't get detected and the code will spin indefinitely. It's the best way I found to prevent it, making sure the code is passing the unit test for the generator.
If someone has a better way to deal with that, I'll be more than happy to apply it!
P.S. I also tried
inspect.isgeneratorobject
, but that will trigger an exception ifsentences
is non-indexable, just like in the unit test case. I guess I could empty-catch it, but I though this was cleaner...