Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,20 @@ def analyze_text(text):
|
|
15 |
else:
|
16 |
return "Neutral π"
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def analyze_video(video_file):
|
19 |
if video_file is None:
|
20 |
return "No video uploaded"
|
|
|
15 |
else:
|
16 |
return "Neutral π"
|
17 |
|
18 |
+
def process_all(text, video):
|
19 |
+
text_sentiment = analyze_sentiment(text)
|
20 |
+
video_emotion = analyze_video_emotion(video)
|
21 |
+
return f"Text Sentiment: {text_sentiment}\nFacial Emotion: {video_emotion}"
|
22 |
+
|
23 |
+
iface = gr.Interface(
|
24 |
+
fn=process_all,
|
25 |
+
inputs=[gr.Textbox(label="Social Media Post"), gr.Video(label="Upload Video")],
|
26 |
+
outputs="text",
|
27 |
+
title="Emotion & Sentiment Analyzer"
|
28 |
+
)
|
29 |
+
|
30 |
+
iface.launch()
|
31 |
+
|
32 |
def analyze_video(video_file):
|
33 |
if video_file is None:
|
34 |
return "No video uploaded"
|