QuratulainButt's picture
Update app.py
75ce8c3 verified
raw
history blame contribute delete
No virus
409 Bytes
import gradio as gr
from transformers import pipeline
model_name = "distilbert/distilbert-base-uncased-finetuned-sst-2-english"
sentiment_analysis = pipeline("text-classification", model=model_name)
def pipe(text):
return "The entered sentence is: " + str(sentiment_analysis (text)[0]["label"])+ "!"
demo = gr.Interface(
fn=pipe,
inputs=["text"],
outputs=["text"],
)
demo.launch()