Spaces:
Running
Running
vickeee465
commited on
Commit
·
0c4081a
1
Parent(s):
d16db8d
remove generated junk
Browse files
app.py
CHANGED
@@ -106,7 +106,6 @@ def plot_sunburst_chart(heatmap_data):
|
|
106 |
sentence = item['sentence']
|
107 |
emotions = item['emotions']
|
108 |
|
109 |
-
# Wrap long sentences for better display
|
110 |
sentence_wrapped = "\n".join([sentence[i:i + 50] for i in range(0, len(sentence), 50)])
|
111 |
|
112 |
for i, score in enumerate(emotions):
|
@@ -118,7 +117,6 @@ def plot_sunburst_chart(heatmap_data):
|
|
118 |
|
119 |
df = pd.DataFrame(data)
|
120 |
|
121 |
-
# Create sunburst chart (no "root" level)
|
122 |
fig = px.sunburst(
|
123 |
df,
|
124 |
path=['sentence', 'emotion'],
|
@@ -128,16 +126,12 @@ def plot_sunburst_chart(heatmap_data):
|
|
128 |
title='Sentence-Level Emotion Confidence Sunburst'
|
129 |
)
|
130 |
|
131 |
-
# Make the chart bigger
|
132 |
fig.update_layout(
|
133 |
width=800,
|
134 |
height=800,
|
135 |
margin=dict(t=50, l=0, r=0, b=0)
|
136 |
)
|
137 |
|
138 |
-
# Display the chart in Streamlit
|
139 |
-
st.plotly_chart(fig, use_container_width=True)
|
140 |
-
|
141 |
return fig
|
142 |
|
143 |
def plot_emotion_barplot(heatmap_data):
|
|
|
106 |
sentence = item['sentence']
|
107 |
emotions = item['emotions']
|
108 |
|
|
|
109 |
sentence_wrapped = "\n".join([sentence[i:i + 50] for i in range(0, len(sentence), 50)])
|
110 |
|
111 |
for i, score in enumerate(emotions):
|
|
|
117 |
|
118 |
df = pd.DataFrame(data)
|
119 |
|
|
|
120 |
fig = px.sunburst(
|
121 |
df,
|
122 |
path=['sentence', 'emotion'],
|
|
|
126 |
title='Sentence-Level Emotion Confidence Sunburst'
|
127 |
)
|
128 |
|
|
|
129 |
fig.update_layout(
|
130 |
width=800,
|
131 |
height=800,
|
132 |
margin=dict(t=50, l=0, r=0, b=0)
|
133 |
)
|
134 |
|
|
|
|
|
|
|
135 |
return fig
|
136 |
|
137 |
def plot_emotion_barplot(heatmap_data):
|