Karthikeyan commited on
Commit
0830766
1 Parent(s): 1687f31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -183,13 +183,13 @@ class LangChain_Document_QA:
183
  return f"customer_emotion:{customer_emotion}\nagent_emotion:{agent_emotion}\nAgent_Sentiment_score:{agent_score}\nCustomer_sentiment_score:{customer_score}"
184
 
185
  def _on_sentiment_btn_click(self):
186
- client,agent=self._history_of_chat()
187
 
188
  customer_emotion=sentiment.emotion_analysis(client)
189
  customer_sentiment_score = sentiment.analyze_sentiment_for_graph(client)
190
 
191
 
192
- scores=self._text_box(customer_emotion,agent_emotion,agent_sentiment_score,customer_sentiment_score)
193
 
194
  customer_fig=self._display_graph(customer_sentiment_score)
195
  customer_fig.update_layout(title="Sentiment Analysis",width=775)
@@ -218,7 +218,7 @@ class LangChain_Document_QA:
218
  with gr.Column(scale=0.8):
219
  txt = gr.Textbox(
220
  show_label=False,
221
- placeholder="Patient",elem_classes="height"
222
  ).style(container=False)
223
 
224
  with gr.Column(scale=0.2):
@@ -269,9 +269,6 @@ class LangChain_Document_QA:
269
  txt_msg.then(lambda: gr.update(interactive=True), None, [txt])
270
  txt.submit(self._suggested_answer,txt,txt3)
271
  button.click(self._agent_text, [chatbot,txt3], chatbot)
272
- # txt2.submit(self._agent_text, [chatbot, txt2], chatbot).then(
273
- # self._agent_text, [chatbot, txt2], chatbot
274
- # )
275
  end_btn.click(self._display_history, [], txt4)
276
  emptyBtn.click(self.clear_func,[],[])
277
  emptyBtn.click(lambda: None, None, chatbot, queue=False)
 
183
  return f"customer_emotion:{customer_emotion}\nagent_emotion:{agent_emotion}\nAgent_Sentiment_score:{agent_score}\nCustomer_sentiment_score:{customer_score}"
184
 
185
  def _on_sentiment_btn_click(self):
186
+ client=self._history_of_chat()
187
 
188
  customer_emotion=sentiment.emotion_analysis(client)
189
  customer_sentiment_score = sentiment.analyze_sentiment_for_graph(client)
190
 
191
 
192
+ scores=self._text_box(customer_emotion,customer_sentiment_score)
193
 
194
  customer_fig=self._display_graph(customer_sentiment_score)
195
  customer_fig.update_layout(title="Sentiment Analysis",width=775)
 
218
  with gr.Column(scale=0.8):
219
  txt = gr.Textbox(
220
  show_label=False,
221
+ placeholder="Patient",
222
  ).style(container=False)
223
 
224
  with gr.Column(scale=0.2):
 
269
  txt_msg.then(lambda: gr.update(interactive=True), None, [txt])
270
  txt.submit(self._suggested_answer,txt,txt3)
271
  button.click(self._agent_text, [chatbot,txt3], chatbot)
 
 
 
272
  end_btn.click(self._display_history, [], txt4)
273
  emptyBtn.click(self.clear_func,[],[])
274
  emptyBtn.click(lambda: None, None, chatbot, queue=False)