Skip to content
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 Mallet's get_sorted_words #169

Open
colinallen opened this issue Mar 20, 2019 · 1 comment
Open

implement Mallet's get_sorted_words #169

colinallen opened this issue Mar 20, 2019 · 1 comment

Comments

@colinallen
Copy link
Member

Please implement get_sorted_words as described here for Mallet: https://stackoverflow.com/questions/40478209/how-is-the-weight-of-a-word-in-a-topic-calculated-in-mallet

If we already have this functionality under a different name, please create an alias for it

@zhaoyang9425
Copy link
Collaborator

I have added the function get_sorted_words() successfully. It is in https://github.com/inpho/vsm/blob/master/vsm/viewer/ldacgsviewer.py
I test it with notebook and it can work well.

from corpus import *
from vsm import *
k = 100
v = lda_v[k]
test = v.get_sorted_words(topic=1)
test[:10]

[(u'\u7ecf', 22807),
(u'\u5377', 16443),
(u'\u8bd1', 8818),
(u'\u7b2c', 6823),
(u'\u5f55', 5781),
(u'\u672c', 4192),
(u'\u85cf', 3544),
(u'\u6cd5', 3448),
(u'\u7eb8', 2897),
(u'\u90e8', 2657)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants