-
-
Save CyrilRJK/ff6843ce16b058c22a1550d89fd14bfe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def get_artm_model(topic_names, dictionary): | |
| # model | |
| model_artm = artm.ARTM(num_topics=len(topic_names), | |
| topic_names=topic_names, | |
| cache_theta=True, | |
| seed=1, | |
| scores=[artm.PerplexityScore(name='PerplexityScore', dictionary=dictionary)], | |
| regularizers=[artm.SmoothSparseThetaRegularizer(name='SparseTheta', tau=-0.2), | |
| artm.SmoothSparsePhiRegularizer(name='SparsePhi', tau=-0.2), | |
| artm.DecorrelatorPhiRegularizer(name='DecorrelatorPhi', tau=2.5e+5)] | |
| # metrics | |
| model_artm.scores.add(artm.TopTokensScore(name='TopTokensScore', num_tokens=5)) | |
| model_artm.initialize(dictionary) | |
| return model_artm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment