Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions") | |
def predict(input): | |
predictions = pipeline(input) | |
return input, {p["label"]: p["score"] for p in predictions} | |
gradio_app = gr.Interface( | |
predict, | |
inputs=gr.Textbox(lines=7, label="Info"), | |
outputs=[gr.Textbox(label="Processed TEXT"), gr.Label(label="Result", num_top_classes=6)], | |
title="Happy? Or Not?", | |
) | |
if __name__ == "__main__": | |
gradio_app.launch() |