taimoor61's picture
Update app.py
f7c8f6a
raw
history blame
674 Bytes
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 six categories: sadness, joy, love, anger, fear, and surprise."
title = "Classify Texts Expressing Emotion"
examples = [["This is such a beautiful place"]]
gr.Interface(fn=classify,
inputs="textbox",
outputs="text",
title=title,
theme="dark",
description=description,
examples=examples,
).launch()