Sa-m commited on
Commit
bb84a6a
1 Parent(s): e72c0a7

Update app.py

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