Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -102,15 +102,16 @@ def main():
|
|
102 |
# Run sentiment analysis
|
103 |
df_sentiment = sentiment_analysis(msg)
|
104 |
|
105 |
-
# Display
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
114 |
|
115 |
# Display the AI response in a collapsible section
|
116 |
with st.expander("Show Sources"):
|
|
|
102 |
# Run sentiment analysis
|
103 |
df_sentiment = sentiment_analysis(msg)
|
104 |
|
105 |
+
# Display the sentiment in a collapsible section
|
106 |
+
with st.expander("Show Sentiment"):
|
107 |
+
# Display negative sentence locations
|
108 |
+
fig = px.scatter(df_sentiment, y='dominant_sentiment', color='dominant_sentiment', size='confidence',
|
109 |
+
hover_data=['content'],
|
110 |
+
color_discrete_map={"neg": "firebrick", "neu": "navajowhite", "pos": "darkgreen"},
|
111 |
+
labels={'dominant_sentiment': 'Sentiment'},
|
112 |
+
title='Sentiment Analysis of the Response')
|
113 |
+
fig.update_layout(width=800, height=300)
|
114 |
+
st.plotly_chart(fig)
|
115 |
|
116 |
# Display the AI response in a collapsible section
|
117 |
with st.expander("Show Sources"):
|