Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
·
cda9219
1
Parent(s):
681c09e
Update app.py
Browse files
app.py
CHANGED
@@ -193,12 +193,12 @@ class LangChain_Document_QA:
|
|
193 |
|
194 |
|
195 |
def _text_box(self,customer_emotion,customer_sentiment_score):
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
return f"Sentiment: \n{customer_sentiment_score[0]} \n {customer_sentiment_score[1]} Emotion: \n{customer_emotion[0]}\n{customer_emotion[1]}\n"
|
202 |
|
203 |
def _on_sentiment_btn_click(self):
|
204 |
client=self._history_of_chat()
|
|
|
193 |
|
194 |
|
195 |
def _text_box(self,customer_emotion,customer_sentiment_score):
|
196 |
+
sentiment_data = customer_sentiment_score
|
197 |
+
emotion_data = customer_emotion
|
198 |
+
sentiment_str = ', '.join([f'{label}: {score}' for label, score in zip(sentiment_data['Sentiment'], sentiment_data['Score'])])
|
199 |
+
emotion_str = ', '.join([f'{emotion}: {score}' for emotion, score in zip(emotion_data['Emotion'], emotion_data['Score'])])
|
200 |
+
return f"Sentiment: {sentiment_str}, Emotion: {emotion_str}"
|
201 |
+
#return f"Sentiment: \n{customer_sentiment_score[0]} \n {customer_sentiment_score[1]} Emotion: \n{customer_emotion[0]}\n{customer_emotion[1]}\n"
|
202 |
|
203 |
def _on_sentiment_btn_click(self):
|
204 |
client=self._history_of_chat()
|