File size: 672 Bytes
973cc88
 
 
 
 
4d200f3
973cc88
4d200f3
 
 
973cc88
c373dd3
 
 
 
 
4d200f3
 
973cc88
4d200f3
973cc88
f7c8f6a
973cc88
4d200f3
f7c8f6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from transformers import pipeline
import gradio as gr

model_checkpoint = "MuntasirHossain/RoBERTa-base-finetuned-emotion"

model = pipeline("text-classification", model=model_checkpoint)

def classify(text):
    label = model(text)[0]["label"]
    return label

description = "This AI model is trained to classify texts expressing human emotion into different categories."
title = "Xoxo's Texts Expressing Emotion"
examples = [["He is very happy Today",
             "NOTE Free Palestien"]]
            

gr.Interface(fn=classify,
    inputs="textbox",
    outputs="text",
    title=title,
    theme="dark",
    description=description,
    examples=examples,
).launch()