Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -2
src/streamlit_app.py
CHANGED
|
@@ -128,16 +128,19 @@ def create_topic_word_bubbles(df_topic_data):
|
|
| 128 |
# Renaming columns to match the output of perform_topic_modeling
|
| 129 |
df_topic_data = df_topic_data.rename(columns={'Topic_ID': 'topic', 'Word': 'word', 'Weight': 'weight'})
|
| 130 |
df_topic_data['x_pos'] = df_topic_data.index # Use index for x-position in the app
|
|
|
|
|
|
|
|
|
|
| 131 |
if df_topic_data.empty:
|
| 132 |
return None
|
| 133 |
fig = px.scatter(
|
| 134 |
df_topic_data,
|
| 135 |
x='x_pos',
|
| 136 |
y='weight',
|
| 137 |
-
size='
|
| 138 |
color='topic',
|
| 139 |
hover_name='word',
|
| 140 |
-
size_max=
|
| 141 |
title='Topic Word Weights (Bubble Chart)',
|
| 142 |
color_discrete_sequence=px.colors.qualitative.Bold,
|
| 143 |
labels={
|
|
|
|
| 128 |
# Renaming columns to match the output of perform_topic_modeling
|
| 129 |
df_topic_data = df_topic_data.rename(columns={'Topic_ID': 'topic', 'Word': 'word', 'Weight': 'weight'})
|
| 130 |
df_topic_data['x_pos'] = df_topic_data.index # Use index for x-position in the app
|
| 131 |
+
|
| 132 |
+
df_topic_data['Exaggerated_Size'] = df_topic_data['weight'] * 100
|
| 133 |
+
|
| 134 |
if df_topic_data.empty:
|
| 135 |
return None
|
| 136 |
fig = px.scatter(
|
| 137 |
df_topic_data,
|
| 138 |
x='x_pos',
|
| 139 |
y='weight',
|
| 140 |
+
size='Exaggerated_Size',
|
| 141 |
color='topic',
|
| 142 |
hover_name='word',
|
| 143 |
+
size_max=80,
|
| 144 |
title='Topic Word Weights (Bubble Chart)',
|
| 145 |
color_discrete_sequence=px.colors.qualitative.Bold,
|
| 146 |
labels={
|