Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ def plot_network_graph(G):
|
|
| 42 |
# 한국어 폰트 설정
|
| 43 |
font_path = "./NanumBarunGothic.ttf"
|
| 44 |
font_prop = fm.FontProperties(fname=font_path)
|
| 45 |
-
plt.
|
| 46 |
|
| 47 |
plt.figure(figsize=(12, 8))
|
| 48 |
|
|
@@ -56,10 +56,9 @@ def plot_network_graph(G):
|
|
| 56 |
|
| 57 |
# 라벨 위치 조정
|
| 58 |
label_pos = {k: (v[0], v[1] + 0.02) for k, v in pos.items()}
|
| 59 |
-
nx.draw_networkx_labels(G, label_pos, font_size=8, font_weight='bold',
|
| 60 |
-
font_family=font_prop.get_name())
|
| 61 |
|
| 62 |
-
plt.title("Network graph", fontsize=16)
|
| 63 |
plt.axis('off')
|
| 64 |
|
| 65 |
img_bytes = io.BytesIO()
|
|
@@ -197,7 +196,7 @@ if 'run_analysis' in st.session_state and st.session_state.run_analysis:
|
|
| 197 |
tfidf_top_words = [(feature_names[i], topic_tfidf[i]) for i in topic_tfidf.argsort()[:-11:-1]]
|
| 198 |
weight = lda_output[:, idx].mean() * 100
|
| 199 |
|
| 200 |
-
topic_name = ", ".join([word for word, _ in lda_top_words[:
|
| 201 |
|
| 202 |
topic_results.append({
|
| 203 |
'topic_num': idx + 1,
|
|
|
|
| 42 |
# 한국어 폰트 설정
|
| 43 |
font_path = "./NanumBarunGothic.ttf"
|
| 44 |
font_prop = fm.FontProperties(fname=font_path)
|
| 45 |
+
plt.rcParams['font.family'] = font_prop.get_name()
|
| 46 |
|
| 47 |
plt.figure(figsize=(12, 8))
|
| 48 |
|
|
|
|
| 56 |
|
| 57 |
# 라벨 위치 조정
|
| 58 |
label_pos = {k: (v[0], v[1] + 0.02) for k, v in pos.items()}
|
| 59 |
+
nx.draw_networkx_labels(G, label_pos, font_size=8, font_weight='bold', font_family=font_prop.get_name())
|
|
|
|
| 60 |
|
| 61 |
+
plt.title("Network graph", fontsize=16, fontproperties=font_prop)
|
| 62 |
plt.axis('off')
|
| 63 |
|
| 64 |
img_bytes = io.BytesIO()
|
|
|
|
| 196 |
tfidf_top_words = [(feature_names[i], topic_tfidf[i]) for i in topic_tfidf.argsort()[:-11:-1]]
|
| 197 |
weight = lda_output[:, idx].mean() * 100
|
| 198 |
|
| 199 |
+
topic_name = ", ".join([word for word, _ in lda_top_words[:5]])
|
| 200 |
|
| 201 |
topic_results.append({
|
| 202 |
'topic_num': idx + 1,
|