sentiment / app.py
alperugurcan's picture
Update app.py
81e5634 verified
raw
history blame contribute delete
429 Bytes
import gradio as gr
from transformers import pipeline
# Load the sentiment analysis model
pipe = pipeline('sentiment-analysis')
# Function to pass user input to the pipeline
def analyze_sentiment(input_text):
return pipe(input_text)
# Create the Gradio interface
demo = gr.Interface(
fn=analyze_sentiment,
inputs=gr.TextArea(label="Enter some text!"),
outputs=gr.JSON(label="Sentiment Result")
)
demo.launch()