Spaces:
Sleeping
Sleeping
File size: 461 Bytes
f4c7831 00f8b37 f4c7831 00f8b37 f4c7831 7fb0561 02a67dd 00f8b37 f4c7831 cd96437 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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)
|