|
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() |
|
|