Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
5 |
outpts=gr.outputs.Label(label="Output")
|
6 |
-
|
|
|
|
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()
|