From 03c8bb9a1f2ffb7ed3a7c6a4febd8fc8bbe4acf6 Mon Sep 17 00:00:00 2001 From: S Mono <10430241+xh2@users.noreply.github.com> Date: Fri, 24 Jul 2020 14:09:57 +0100 Subject: [PATCH 1/4] Make docs clearer on `alpha` parameter in LDA model --- gensim/models/ldamodel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gensim/models/ldamodel.py b/gensim/models/ldamodel.py index afb0e035c9..c623814fe0 100755 --- a/gensim/models/ldamodel.py +++ b/gensim/models/ldamodel.py @@ -378,8 +378,9 @@ def __init__(self, corpus=None, num_topics=100, id2word=None, Can be set to an 1D array of length equal to the number of expected topics that expresses our a-priori belief for the each topics' probability. Alternatively default prior selecting strategies can be employed by supplying a string: - - * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / topicno`. + + * 'symmetric': Default; uses a fixed symmetric prior per topic, + * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(topic_no))`, * 'auto': Learns an asymmetric prior from the corpus (not available if `distributed==True`). eta : {float, np.array, str}, optional A-priori belief on word probability, this can be: @@ -536,7 +537,8 @@ def init_dir_prior(self, prior, name): If `name` == 'alpha', then the prior can be: * an 1D array of length equal to the number of expected topics, - * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / topicno`. + * 'symmetric': Uses a fixed symmetric prior per topic, + * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(topic_no))`, * 'auto': Learns an asymmetric prior from the corpus. name : {'alpha', 'eta'} Whether the `prior` is parameterized by the alpha vector (1 parameter per topic) From 25005c53a00e20900b608a4dbc6d27a648668ab6 Mon Sep 17 00:00:00 2001 From: Gordon Mohr Date: Sat, 25 Jul 2020 23:54:06 -0700 Subject: [PATCH 2/4] rm whitespace --- gensim/models/ldamodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/models/ldamodel.py b/gensim/models/ldamodel.py index c623814fe0..afe2b088c2 100755 --- a/gensim/models/ldamodel.py +++ b/gensim/models/ldamodel.py @@ -378,7 +378,7 @@ def __init__(self, corpus=None, num_topics=100, id2word=None, Can be set to an 1D array of length equal to the number of expected topics that expresses our a-priori belief for the each topics' probability. Alternatively default prior selecting strategies can be employed by supplying a string: - + * 'symmetric': Default; uses a fixed symmetric prior per topic, * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(topic_no))`, * 'auto': Learns an asymmetric prior from the corpus (not available if `distributed==True`). From f34956c0cf803b12859a8258f7ccac013264bb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20=C5=98eh=C5=AF=C5=99ek?= Date: Sun, 26 Jul 2020 11:01:07 +0200 Subject: [PATCH 3/4] Update gensim/models/ldamodel.py --- gensim/models/ldamodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/models/ldamodel.py b/gensim/models/ldamodel.py index afe2b088c2..aa0a90f1bb 100755 --- a/gensim/models/ldamodel.py +++ b/gensim/models/ldamodel.py @@ -380,7 +380,7 @@ def __init__(self, corpus=None, num_topics=100, id2word=None, Alternatively default prior selecting strategies can be employed by supplying a string: * 'symmetric': Default; uses a fixed symmetric prior per topic, - * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(topic_no))`, + * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(num_topics))`, * 'auto': Learns an asymmetric prior from the corpus (not available if `distributed==True`). eta : {float, np.array, str}, optional A-priori belief on word probability, this can be: From 7d0ef9e2ce311c3eab1663bab6298070a1b131d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20=C5=98eh=C5=AF=C5=99ek?= Date: Sun, 26 Jul 2020 11:01:15 +0200 Subject: [PATCH 4/4] Update gensim/models/ldamodel.py --- gensim/models/ldamodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/models/ldamodel.py b/gensim/models/ldamodel.py index aa0a90f1bb..eb65150f23 100755 --- a/gensim/models/ldamodel.py +++ b/gensim/models/ldamodel.py @@ -538,7 +538,7 @@ def init_dir_prior(self, prior, name): * an 1D array of length equal to the number of expected topics, * 'symmetric': Uses a fixed symmetric prior per topic, - * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(topic_no))`, + * 'asymmetric': Uses a fixed normalized asymmetric prior of `1.0 / (topic_index + sqrt(num_topics))`, * 'auto': Learns an asymmetric prior from the corpus. name : {'alpha', 'eta'} Whether the `prior` is parameterized by the alpha vector (1 parameter per topic)