nibbz2024 commited on
Commit
154e1a5
1 Parent(s): 7acad9d

Update app.py

Browse files

Changed number of topics being generated from 10 to 6

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,7 +76,7 @@ def process_text(texts, stop_words, bigram_mod, nlp):
76
 
77
  return data_lemmatized
78
 
79
- def create_lda_model(corpus, id2word, num_topics=10):
80
  lda_model = gensim.models.LdaModel(corpus=corpus,
81
  id2word=id2word,
82
  num_topics=num_topics,
@@ -123,7 +123,7 @@ def topic_modeling(reviews):
123
  corpus = [id2word.doc2bow(text) for text in processed_data]
124
 
125
  # Create LDA model
126
- lda_model = create_lda_model(corpus, id2word, num_topics=10)
127
 
128
  # Print topics
129
  topics = print_topics(lda_model)
 
76
 
77
  return data_lemmatized
78
 
79
+ def create_lda_model(corpus, id2word, num_topics=6):
80
  lda_model = gensim.models.LdaModel(corpus=corpus,
81
  id2word=id2word,
82
  num_topics=num_topics,
 
123
  corpus = [id2word.doc2bow(text) for text in processed_data]
124
 
125
  # Create LDA model
126
+ lda_model = create_lda_model(corpus, id2word, num_topics=6)
127
 
128
  # Print topics
129
  topics = print_topics(lda_model)