fixed local variables
Browse files
app.py
CHANGED
@@ -209,6 +209,7 @@ def dataframeProcessing(dataset):
|
|
209 |
df['lemma_tokens'] = df['lemmas_back_to_text'].apply(tokenize)
|
210 |
|
211 |
# Create a id2word dictionary
|
|
|
212 |
id2word = Dictionary(df['lemma_tokens'])
|
213 |
|
214 |
# Filtering Extremes
|
@@ -239,6 +240,8 @@ def dataframeProcessing(dataset):
|
|
239 |
step=1)
|
240 |
|
241 |
k_max = max(coherence_values)
|
|
|
|
|
242 |
num_topics = coherence_values.index(k_max) + 2
|
243 |
|
244 |
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
|
|
|
209 |
df['lemma_tokens'] = df['lemmas_back_to_text'].apply(tokenize)
|
210 |
|
211 |
# Create a id2word dictionary
|
212 |
+
global id2word
|
213 |
id2word = Dictionary(df['lemma_tokens'])
|
214 |
|
215 |
# Filtering Extremes
|
|
|
240 |
step=1)
|
241 |
|
242 |
k_max = max(coherence_values)
|
243 |
+
|
244 |
+
global num_topics
|
245 |
num_topics = coherence_values.index(k_max) + 2
|
246 |
|
247 |
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
|