diff --git a/data-computer/v1/lda.py b/data-computer/v1/lda.py index 66c4535..426a137 100755 --- a/data-computer/v1/lda.py +++ b/data-computer/v1/lda.py @@ -119,7 +119,7 @@ topic_info = {} for topic_id, topic_weight in topics: topic_info[f"topic_{topic_id + 1}"] = {} - topic_words = [word for word, _ in lda_model.show_topic(topic_id)] + topic_words = [{"word":word, "word_weight":str(word_weight)} for word, word_weight in lda_model.show_topic(topic_id)] topic_info[f"topic_{topic_id + 1}"]["words"] = topic_words topic_info[f"topic_{topic_id + 1}"]["weight"] = str(topic_weight)