MarMont commited on
Commit
3d86f74
1 Parent(s): 555572e

remove model_list

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -148,7 +148,7 @@ def compute_coherence_values_base_lda(dictionary, corpus, texts, limit, coherenc
148
  coherencemodel = CoherenceModel(model=model, texts=texts, dictionary=dictionary, coherence=coherence)
149
  coherence_values.append(coherencemodel.get_coherence())
150
 
151
- return model_list, coherence_values
152
 
153
  def compute_coherence_values2(corpus, dictionary, k, a, b):
154
  lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
@@ -275,14 +275,13 @@ def full_lda(df):
275
  training_corpus = corpus_split
276
  training_corpus.remove(training_corpus[i])
277
  # print(training_corpus[i])
278
- model_list, coherence_values = compute_coherence_values_base_lda(dictionary=id2word,
279
  corpus=training_corpus,
280
  texts=df['lemma_tokens'],
281
  start=2,
282
  limit=10,
283
  step=1,
284
  coherence='c_v')
285
- # print(model_list + str(i))
286
  # print(coherence_values + str(i))
287
  for j in range(len(coherence_values)):
288
  coherence_averages[j] += coherence_values[j]
 
148
  coherencemodel = CoherenceModel(model=model, texts=texts, dictionary=dictionary, coherence=coherence)
149
  coherence_values.append(coherencemodel.get_coherence())
150
 
151
+ return coherence_values
152
 
153
  def compute_coherence_values2(corpus, dictionary, k, a, b):
154
  lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
 
275
  training_corpus = corpus_split
276
  training_corpus.remove(training_corpus[i])
277
  # print(training_corpus[i])
278
+ coherence_values = compute_coherence_values_base_lda(dictionary=id2word,
279
  corpus=training_corpus,
280
  texts=df['lemma_tokens'],
281
  start=2,
282
  limit=10,
283
  step=1,
284
  coherence='c_v')
 
285
  # print(coherence_values + str(i))
286
  for j in range(len(coherence_values)):
287
  coherence_averages[j] += coherence_values[j]