Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,14 +68,14 @@ def plot_network_graph(G):
|
|
| 68 |
|
| 69 |
node_colors = [G.nodes[node]['color'] for node in G.nodes()]
|
| 70 |
|
| 71 |
-
nx.draw(G, pos, node_color=node_colors, with_labels=True, node_size=
|
| 72 |
font_weight='bold', edge_color='gray', width=0.5, font_family=font_prop.get_name())
|
| 73 |
|
| 74 |
for node, (x, y) in pos.items():
|
| 75 |
plt.text(x, y, node, fontsize=8, fontweight='bold', ha='center', va='center',
|
| 76 |
-
|
| 77 |
|
| 78 |
-
plt.title("
|
| 79 |
plt.axis('off')
|
| 80 |
|
| 81 |
img_bytes = io.BytesIO()
|
|
@@ -271,9 +271,9 @@ if 'run_analysis' in st.session_state and st.session_state.run_analysis:
|
|
| 271 |
|
| 272 |
st.header("토픽 단어 네트워크 그래프")
|
| 273 |
try:
|
| 274 |
-
G = create_network_graph(topic_results, num_words=
|
| 275 |
img_bytes = plot_network_graph(G)
|
| 276 |
-
st.image(img_bytes, caption="
|
| 277 |
|
| 278 |
# 다운로드 버튼 추가
|
| 279 |
st.download_button(
|
|
|
|
| 68 |
|
| 69 |
node_colors = [G.nodes[node]['color'] for node in G.nodes()]
|
| 70 |
|
| 71 |
+
nx.draw(G, pos, node_color=node_colors, with_labels=True, node_size=1000, font_size=8,
|
| 72 |
font_weight='bold', edge_color='gray', width=0.5, font_family=font_prop.get_name())
|
| 73 |
|
| 74 |
for node, (x, y) in pos.items():
|
| 75 |
plt.text(x, y, node, fontsize=8, fontweight='bold', ha='center', va='center',
|
| 76 |
+
fontproperties=font_prop)
|
| 77 |
|
| 78 |
+
plt.title("Network graph", fontsize=16)
|
| 79 |
plt.axis('off')
|
| 80 |
|
| 81 |
img_bytes = io.BytesIO()
|
|
|
|
| 271 |
|
| 272 |
st.header("토픽 단어 네트워크 그래프")
|
| 273 |
try:
|
| 274 |
+
G = create_network_graph(topic_results, num_words=20) # 상위 10개 단어만 사용
|
| 275 |
img_bytes = plot_network_graph(G)
|
| 276 |
+
st.image(img_bytes, caption="토픽별 상위 20개 단어 네트워크", use_column_width=True)
|
| 277 |
|
| 278 |
# 다운로드 버튼 추가
|
| 279 |
st.download_button(
|