Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -254,7 +254,6 @@ def visualize_emotions():
|
|
254 |
plt.close()
|
255 |
|
256 |
return 'emotional_state.png'
|
257 |
-
|
258 |
def interactive_interface(input_text):
|
259 |
global conversation_history
|
260 |
try:
|
@@ -288,28 +287,26 @@ def interactive_interface(input_text):
|
|
288 |
|
289 |
emotion_visualization = visualize_emotions()
|
290 |
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
return analysis_result
|
302 |
except Exception as e:
|
303 |
print(f"Error: {e}")
|
304 |
-
return
|
305 |
-
'
|
306 |
-
'
|
307 |
-
|
308 |
-
'
|
309 |
-
|
310 |
-
|
311 |
-
'
|
312 |
-
|
313 |
|
314 |
# Create a Gradio interface
|
315 |
gr.Interface(
|
|
|
254 |
plt.close()
|
255 |
|
256 |
return 'emotional_state.png'
|
|
|
257 |
def interactive_interface(input_text):
|
258 |
global conversation_history
|
259 |
try:
|
|
|
287 |
|
288 |
emotion_visualization = visualize_emotions()
|
289 |
|
290 |
+
return (
|
291 |
+
predicted_emotion,
|
292 |
+
ai_emotion,
|
293 |
+
str(sentiment_scores),
|
294 |
+
str(entities),
|
295 |
+
str(text_complexity),
|
296 |
+
response,
|
297 |
+
emotion_visualization
|
298 |
+
)
|
|
|
|
|
299 |
except Exception as e:
|
300 |
print(f"Error: {e}")
|
301 |
+
return (
|
302 |
+
'unknown',
|
303 |
+
'neutral',
|
304 |
+
str({'compound': 0, 'neg': 0, 'neu': 1, 'pos': 0}),
|
305 |
+
'[]',
|
306 |
+
str({'word_count': 0, 'sentence_count': 0, 'average_sentence_length': 0, 'polarity': 0, 'subjectivity': 0}),
|
307 |
+
"I'm sorry, but I encountered an error and was unable to generate a response.",
|
308 |
+
'emotional_state.png'
|
309 |
+
)
|
310 |
|
311 |
# Create a Gradio interface
|
312 |
gr.Interface(
|