clothing_bert / app.py
Preetham04's picture
Update app.py
7fb0561 verified
raw
history blame
No virus
461 Bytes
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="text-classification", model="Preetham04/sentiment-analysis")
def predict(input_text):
predictions = pipeline(input_text)
return input_text, {p["label"]: p["score"] for p in predictions}
gradio_app = gr.Interface(
predict,
inputs="textbox",
outputs="text",
title="Sentiment- good or bad?",
)
if __name__ == "__main__":
gradio_app.launch(share=True)