Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +13 -1
src/streamlit_app.py
CHANGED
|
@@ -218,11 +218,19 @@ with tab1:
|
|
| 218 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 219 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 220 |
fig_pie.update_layout(paper_bgcolor='#F5FFFA', plot_bgcolor='#F5FFFA')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
st.plotly_chart(fig_pie)
|
| 222 |
with col2:
|
| 223 |
st.subheader("Bar chart", divider="green")
|
| 224 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 225 |
fig_bar.update_layout(paper_bgcolor='#F5FFFA', plot_bgcolor='#F5FFFA')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
st.plotly_chart(fig_bar)
|
| 227 |
st.subheader("Most Frequent Entities", divider="green")
|
| 228 |
word_counts = df['text'].value_counts().reset_index()
|
|
@@ -325,7 +333,7 @@ with tab2:
|
|
| 325 |
st.subheader("Extracted Answers", divider="green")
|
| 326 |
expander = st.expander("**Download**")
|
| 327 |
expander.write("""
|
| 328 |
-
|
| 329 |
""")
|
| 330 |
st.dataframe(df, use_container_width=True)
|
| 331 |
st.subheader("Tree map", divider="green")
|
|
@@ -333,6 +341,10 @@ with tab2:
|
|
| 333 |
label_color_map = {label: get_stable_color(label) for label in all_labels}
|
| 334 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'question', 'answer'], values='score', color='question', color_discrete_map=label_color_map)
|
| 335 |
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25), paper_bgcolor='#F3E5F5', plot_bgcolor='#F3E5F5')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
st.plotly_chart(fig_treemap)
|
| 337 |
if comet_initialized:
|
| 338 |
experiment.log_metric("processing_time_seconds", elapsed_time)
|
|
|
|
| 218 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 219 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 220 |
fig_pie.update_layout(paper_bgcolor='#F5FFFA', plot_bgcolor='#F5FFFA')
|
| 221 |
+
expander = st.expander("**Download**")
|
| 222 |
+
expander.write("""
|
| 223 |
+
You can easily download the pie chart by hovering over it. Look for the download icon that appears in the top right corner.
|
| 224 |
+
""")
|
| 225 |
st.plotly_chart(fig_pie)
|
| 226 |
with col2:
|
| 227 |
st.subheader("Bar chart", divider="green")
|
| 228 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 229 |
fig_bar.update_layout(paper_bgcolor='#F5FFFA', plot_bgcolor='#F5FFFA')
|
| 230 |
+
expander = st.expander("**Download**")
|
| 231 |
+
expander.write("""
|
| 232 |
+
You can easily download the bar chart by hovering over it. Look for the download icon that appears in the top right corner.
|
| 233 |
+
""")
|
| 234 |
st.plotly_chart(fig_bar)
|
| 235 |
st.subheader("Most Frequent Entities", divider="green")
|
| 236 |
word_counts = df['text'].value_counts().reset_index()
|
|
|
|
| 333 |
st.subheader("Extracted Answers", divider="green")
|
| 334 |
expander = st.expander("**Download**")
|
| 335 |
expander.write("""
|
| 336 |
+
To download the data, simply hover your cursor over the table. A download icon will appear in the top right corner.
|
| 337 |
""")
|
| 338 |
st.dataframe(df, use_container_width=True)
|
| 339 |
st.subheader("Tree map", divider="green")
|
|
|
|
| 341 |
label_color_map = {label: get_stable_color(label) for label in all_labels}
|
| 342 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'question', 'answer'], values='score', color='question', color_discrete_map=label_color_map)
|
| 343 |
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25), paper_bgcolor='#F3E5F5', plot_bgcolor='#F3E5F5')
|
| 344 |
+
expander = st.expander("**Download**")
|
| 345 |
+
expander.write("""
|
| 346 |
+
You can easily download the treemap by hovering over it. Look for the download icon that appears in the top right corner.
|
| 347 |
+
""")
|
| 348 |
st.plotly_chart(fig_treemap)
|
| 349 |
if comet_initialized:
|
| 350 |
experiment.log_metric("processing_time_seconds", elapsed_time)
|