Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ model_checkpoint = "MuntasirHossain/RoBERTa-base-finetuned-emotion"
|
|
5 |
|
6 |
model = pipeline("text-classification", model=model_checkpoint)
|
7 |
|
|
|
8 |
def classify(text):
|
9 |
label = model(text)[0]["label"]
|
10 |
return label
|
@@ -13,13 +14,36 @@ description = "This AI model is trained to classify texts expressing human emoti
|
|
13 |
title = "Xoxo's Texts Expressing Emotion"
|
14 |
examples = [["He is very happy Today",
|
15 |
"NOTE Free Palestien"]]
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
gr.Interface(fn=classify,
|
19 |
inputs="textbox",
|
20 |
outputs="text",
|
21 |
title=title,
|
22 |
-
theme=
|
23 |
description=description,
|
24 |
examples=examples,
|
25 |
).launch()
|
|
|
5 |
|
6 |
model = pipeline("text-classification", model=model_checkpoint)
|
7 |
|
8 |
+
|
9 |
def classify(text):
|
10 |
label = model(text)[0]["label"]
|
11 |
return label
|
|
|
14 |
title = "Xoxo's Texts Expressing Emotion"
|
15 |
examples = [["He is very happy Today",
|
16 |
"NOTE Free Palestien"]]
|
17 |
+
|
18 |
+
theme = {
|
19 |
+
"container": {
|
20 |
+
"background-color": "#007bff",
|
21 |
+
"color": "#fff",
|
22 |
+
"padding": "20px",
|
23 |
+
},
|
24 |
+
"textbox": {
|
25 |
+
"background-color": "#fff",
|
26 |
+
"border-radius": "5px",
|
27 |
+
"padding": "10px",
|
28 |
+
"margin-bottom": "10px",
|
29 |
+
},
|
30 |
+
"button": {
|
31 |
+
"background-color": "#007bff",
|
32 |
+
"color": "#fff",
|
33 |
+
"padding": "10px",
|
34 |
+
"border-radius": "5px",
|
35 |
+
"cursor": "pointer",
|
36 |
+
},
|
37 |
+
"label": {
|
38 |
+
"color": "#fff",
|
39 |
+
},
|
40 |
+
}
|
41 |
|
42 |
gr.Interface(fn=classify,
|
43 |
inputs="textbox",
|
44 |
outputs="text",
|
45 |
title=title,
|
46 |
+
theme=theme,
|
47 |
description=description,
|
48 |
examples=examples,
|
49 |
).launch()
|