-
-
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
[MRG] API for Static Topic for word in Vocabulary. #706
Conversation
Thanks. Can the output be in same format as |
Would that mean a tuple with that word and corresponding topic? |
@tmylk made it the same format as |
@@ -905,6 +905,28 @@ def get_document_topics(self, bow, minimum_probability=None): | |||
return [(topicid, topicvalue) for topicid, topicvalue in enumerate(topic_dist) | |||
if topicvalue >= minimum_probability] | |||
|
|||
def get_static_topic(self, word_id, minimum_probability=None): |
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.
Default minimum_probability=0 is most intuitive
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 disagree. 0.0
is a specific value to use, whereas None
stands for "use default". Different semantics.
@tmylk , @piskvorky , could you please review? I've finished and wrote tests. |
@@ -905,6 +905,28 @@ def get_document_topics(self, bow, minimum_probability=None): | |||
return [(topicid, topicvalue) for topicid, topicvalue in enumerate(topic_dist) | |||
if topicvalue >= minimum_probability] | |||
|
|||
def get_static_topic(self, word_id, minimum_probability=None): | |||
""" | |||
Returns static topics for word in vocabulary. |
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.
Needs better docs -- what is a "static topic"?
The method name doesn't seem right; @cscorley any better ideas? Maybe |
@piskvorky , yeah |
Looks good, thanks @bhargavvader . I leave the final sanity checks & merge touches to @tmylk |
Just a note in the changelog and then ready to merge. |
@tmylk done! |
Yep, |
@tmylk when are you planning to release? This version is getting scarily bulky again. Does it make sense to release before the PyCon coding sprint, so people can work off a fresh version? |
@tmylk to complement the dynamic word document topic, this is a PR for static word topics.