-
-
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
Allow use of truncated Dictionary for coherence measures #1349
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
9d06a1f
#1342: Allow use of truncated `Dictionary` for coherence calculation …
f69a2ff
#1342: Do not produce sliding windows for texts with no relevant word…
26de547
#1342: Remove unused multiprocessing import in `coherencemodel` module.
dfe159b
add utility functions for strided windowing of texts (lists of string…
2e3852e
handle edge cases with window_size equal to or exceeding document siz…
ec7af1b
move code for building inverted index into a new text_analysis module…
3f8fb7f
complete migration to using the accumulators in the new text_analysis…
b12edef
fix bug in WordOccurrenceAccumulator so that co-occurrences of same w…
91b8a05
make wikicorpus parsing handle KeyboardInterrupt gracefully
c6224b7
add ParallelWordOccurrenceAccumulator and make default method for p_b…
f00d389
clean up, clarify, and optimize the indirect_confirmation_measure.cos…
327b739
#1342: Cleanup, documentation improvements, proper caching of accumul…
3c0752b
Merge branch 'develop' into develop
macks22 e06c7c3
#1342: Do not swallow `KeyboardInterrupt` naively in `WikiCorpus.get_…
2ca43f7
#1342: Formatting fixes (hanging indent in `coherencemodel` and non-e…
825b0e9
#1342: Improve `CoherenceModel` documentation and minor refactor for …
314a400
#1342: Optimize word occurrence accumulation and fix a bug with repea…
e785773
#1342: Minor bug fixes and improved logging in text_analysis module; …
5f78cdb
#1342: Optimize data structures being used for window set tracking an…
bbd2748
#1342: Fix accidental typo.
5fb0b95
#1342: Further optimize word co-occurrence accumulation by using a `c…
880b8d0
#1342: Clean up logging in `text_analysis` module and remove empty li…
1d32b8e
#1342: Remove unused traceback module.
8e04b41
#1342: Fixes for python3 compatibility.
e3ce402
#1342: Hopefully `six.viewitems` works for python3 compatibility?
7f7f55d
#1342: Realized the python3 compatibility issue was due to the Dictio…
343da69
#1342: Fixed a few bugs and added test coverage for the coherencemode…
1ce8a72
#1342: Further tests for persistence of accumulator.
96fd343
#1342: Add test case for `CorpusAccumulator`.
a631ab6
#1342: Formatting fixes for hanging indents and overly long lines.
5f58bda
#1342: Fix `indirect_confirmation_measure.cosine_similarity` to retur…
b941f3c
#1342: Fix `direct_confirmation_measure` functions to return individu…
75fcac8
#1342: Hanging indents and switch out `union` with `update` for uniqu…
96d1349
#1342: Clarify documentation in the `probability_estimation` module.
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
Oops, something went wrong.
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? Masking user interrupts is an anti-pattern; deserves a detailed comment, at the very least.
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've updated the code to handle the interrupt more appropriately. As for why I chose to handle the interrupt at all (at the risk of repeating the above comment): this pool may be active during many other phases of gensim execution if the underlying corpus/texts being iterated come from the
wikicorpus
. It was confusing for me to see stdout activity when issuing an interrupt during execution of an entirely different code path.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.
Sorry, not sure I understand.
When iterating over a
WikiCorpus
, gensim uses amultiprocessing.Pool
(forks), yes.Now when you do CTRL+C, what happened (old behaviour)? And what happens now (after your changes here)? Why is that preferable?
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.
Here is the code I am running:
Before:
After:
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.
So the advantage is a cleaner log?
What are the disadvantages? (I am not familiar with this type of functionality, but I assume there must be some disadvantages, otherwise it would be the default behaviour).