Karthikeyan commited on
Commit
09e414c
1 Parent(s): e59d9c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -126,7 +126,7 @@ class LangChain_Document_QA:
126
  scores = sentiment_scores.values()
127
  fig = px.bar(x=scores, y=labels, orientation='h', color=labels, color_discrete_map={"Negative": "red", "Positive": "green", "Neutral": "gray"})
128
  fig.update_traces(texttemplate='%{x:.2f}%', textposition='outside')
129
- fig.update_layout(height=500, width=150)
130
  return fig
131
  def _display_graph_emotion(self,customer_emotion_score):
132
  fig = px.pie(customer_emotion_score, values='Score', names='Emotion', title='Emotion Distribution', hover_data=['Score'])
@@ -199,12 +199,12 @@ class LangChain_Document_QA:
199
  scores=self._text_box(customer_emotion,customer_sentiment_score)
200
 
201
  customer_fig=self._display_graph(customer_sentiment_score)
202
- customer_fig.update_layout(title="Sentiment Analysis",width=770)
203
 
204
  customer_emotion_score = sentiment.emotion_analysis_for_graph(customer_emotion)
205
 
206
  customer_emotion_fig=self._display_graph_emotion(customer_emotion_score)
207
- customer_emotion_fig.update_layout(title="Emotion Analysis",width=770)
208
  print("scores :",scores)
209
  print("customer_fig :",customer_fig)
210
  print("customer_emotion_fig :",customer_emotion_fig)
 
126
  scores = sentiment_scores.values()
127
  fig = px.bar(x=scores, y=labels, orientation='h', color=labels, color_discrete_map={"Negative": "red", "Positive": "green", "Neutral": "gray"})
128
  fig.update_traces(texttemplate='%{x:.2f}%', textposition='outside')
129
+ fig.update_layout(height=500, width=200)
130
  return fig
131
  def _display_graph_emotion(self,customer_emotion_score):
132
  fig = px.pie(customer_emotion_score, values='Score', names='Emotion', title='Emotion Distribution', hover_data=['Score'])
 
199
  scores=self._text_box(customer_emotion,customer_sentiment_score)
200
 
201
  customer_fig=self._display_graph(customer_sentiment_score)
202
+ customer_fig.update_layout(title="Sentiment Analysis",width=740)
203
 
204
  customer_emotion_score = sentiment.emotion_analysis_for_graph(customer_emotion)
205
 
206
  customer_emotion_fig=self._display_graph_emotion(customer_emotion_score)
207
+ customer_emotion_fig.update_layout(title="Emotion Analysis",width=700)
208
  print("scores :",scores)
209
  print("customer_fig :",customer_fig)
210
  print("customer_emotion_fig :",customer_emotion_fig)