Spaces:
Sleeping
Sleeping
Update src/data_preprocessing.py
Browse files- src/data_preprocessing.py +0 -26
src/data_preprocessing.py
CHANGED
@@ -94,29 +94,3 @@ def visualize(topics, df, W1, H1, lda_model, vectorizer):
|
|
94 |
ax.invert_yaxis()
|
95 |
|
96 |
return histogram_fig, fig
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
# df_doc_topic
|
102 |
-
# print("Perplexity: ", lda_model.perplexity(countidf_vectors))
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
# sns.heatmap(df_doc_topic.corr())
|
108 |
-
# plt.show()
|
109 |
-
|
110 |
-
|
111 |
-
# fig, axes = plt.subplots(2, 4, figsize=(30, 15), sharex=True)
|
112 |
-
# axes = axes.flatten()
|
113 |
-
# for topic_idx, topic in enumerate(best_lda_model.components_):
|
114 |
-
# top_features_ind = topic.argsort()[:-10 - 1:-1]
|
115 |
-
# top_features = [vectorizer_count.get_feature_names_out()[i] for i in top_features_ind]
|
116 |
-
# weights = topic[top_features_ind]
|
117 |
-
|
118 |
-
# ax = axes[topic_idx]
|
119 |
-
# ax.barh(top_features, weights, height=0.7)
|
120 |
-
# ax.set_title(f'Topic {topic_idx +1}')
|
121 |
-
# ax.invert_yaxis()
|
122 |
-
# plt.show()
|
|
|
94 |
ax.invert_yaxis()
|
95 |
|
96 |
return histogram_fig, fig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|