logu29 commited on
Commit
5152cc0
·
verified ·
1 Parent(s): 33592cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -21
app.py CHANGED
@@ -1,24 +1,17 @@
1
  import gradio as gr
2
 
3
- with gr.Blocks() as app:
4
- gr.Markdown("# Emotion Decoder - Social Media Posts")
5
-
6
- with gr.Tab("Analyze Text"):
7
- text_in = gr.Textbox(label="Paste Social Media Post Text")
8
- text_out = gr.Textbox(label="Result")
9
- text_button = gr.Button("Analyze Text")
10
- text_button.click(fn=analyze_text, inputs=text_in, outputs=text_out)
11
-
12
- with gr.Tab("Analyze Face Image"):
13
- face_in = gr.Image(type="filepath", label="Upload Face Image")
14
- face_out = gr.Textbox(label="Result")
15
- face_button = gr.Button("Analyze Face")
16
- face_button.click(fn=analyze_face, inputs=face_in, outputs=face_out)
17
-
18
- with gr.Tab("Analyze Video File"):
19
- video_in = gr.Video(label="Upload Social Media Video")
20
- video_out = gr.Textbox(label="Result")
21
- video_button = gr.Button("Analyze Video")
22
- video_button.click(fn=analyze_video, inputs=video_in, outputs=video_out)
23
 
24
- app.launch(share=True)
 
1
  import gradio as gr
2
 
3
+ from transforme import pipeline
4
+
5
+ sentiment = pipeline("emoition-analysis")
6
+
7
+ def get_emotion( input_text):
8
+ return emotion(input_text)
9
+
10
+ iface = gr.Inface(in = get_emotion,
11
+ input = "text",
12
+ outputs = ["text"],
13
+ title = 'emotion analysis',
14
+ description='get emotion negative/positive for the given input')
15
+
16
+ iface.lanch(inline = false)
 
 
 
 
 
 
17