-
Notifications
You must be signed in to change notification settings - Fork 12
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
Topic modeling #37
Open
mgasvoda
wants to merge
17
commits into
dev
Choose a base branch
from
topic_modeling
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Topic modeling #37
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b07786a
modifying lda class structure
mgasvoda 257131d
adjusting lda model, adding parameters for grid search
mgasvoda 265cc83
adjusting lda model, adding parameters for grid search
mgasvoda bb5f036
adding topic modeling dependencies
mgasvoda 2a15b32
fixing syntax
mgasvoda c3faebf
lowercasing words
mgasvoda c6b764d
adding sklearn api version
mgasvoda a17ed34
initial commit testing topic model
mgasvoda d5592f0
loading all models for testing
mgasvoda 58513f7
passing topic model test
mgasvoda aac7d98
updating travis config dependencies
mgasvoda ef9853f
checking import before initializing
mgasvoda c97c6df
adjusting dependencies, variable names
mgasvoda aaffd94
moving stopword removal
mgasvoda 58db43a
restructuring stopword args, adjusting min word freq
mgasvoda 30af4c2
providing wrapper for show_topics
mgasvoda 31a35ca
Merge branch 'dev' of github.com:QuantGov/quantgov into topic_modeling
mgasvoda 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,10 @@ def find_version(*file_paths): | |
'nlp': [ | ||
'textblob', | ||
'nltk', | ||
], | ||
'topic_modeling': [ | ||
'gensim', | ||
'spacy' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we not need a spacy corpus as well? |
||
] | ||
}, | ||
entry_points={ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# import pytest | ||
import subprocess | ||
import quantgov.estimator | ||
import quantgov | ||
|
||
from pathlib import Path | ||
|
||
PSEUDO_CORPUS_PATH = Path(__file__).resolve().parent.joinpath('pseudo_corpus') | ||
driver = quantgov.load_driver(PSEUDO_CORPUS_PATH) | ||
|
||
|
||
def test_topic_model(): | ||
sample = quantgov.estimator.structures.GensimLda() | ||
sample.fit(driver, num_topics=2) | ||
sample.transform(driver) | ||
|
||
|
||
def check_output(cmd): | ||
return ( | ||
subprocess.check_output(cmd, universal_newlines=True) | ||
.replace('\n\n', '\n') | ||
) |
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.
Why are we doing this?
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.
Filtering out words that only occur once was recommended in the Gensim documentation - beyond that, I don't know if it actually improves the performance of the model.