Sa-m commited on
Commit
6742665
1 Parent(s): 4260e5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,6 +1,13 @@
1
  import gradio as gr
 
2
 
3
- io1 = gr.Interface.load('huggingface/MilaNLProc/xlm-emo-t')
4
- inputs = gr.inputs.Textbox(lines = 10, label="Text")
 
 
 
 
 
5
  outpts=gr.outputs.Label(label="Output")
6
- gr.Interface(io1, inputs=inputs,outputs=outpts, title='Emotions Analyser',theme='peach').launch()
 
 
1
  import gradio as gr
2
+ from xlm_emo.classifier import EmotionClassifier
3
 
4
+
5
+ def emotionClassifier(text):
6
+ ec = EmotionClassifier()
7
+ translation = ec.predict([text])
8
+ res=translation[0]
9
+ return res
10
+ inputs = gr.inputs.Textbox(lines = 2, label="Text")
11
  outpts=gr.outputs.Label(label="Output")
12
+
13
+ gr.Interface(emotionClassifier, inputs=inputs,outputs=outpts, title='Emotions Analyser',theme='peach').launch()