example_2 / app.py
oldgarden21's picture
Update app.py
dcea58a verified
Raw
History Blame Contribute Delete
409 Bytes
import gradio as gr
from transformers import pipeline
# ๊ฐ์ • ๋ถ„์„ ํŒŒ์ดํ”„๋ผ์ธ ์ดˆ๊ธฐํ™”
sentiment_analysis = pipeline("sentiment-analysis")
def predict_sentiment(text):
result = sentiment_analysis(text)
return result[0]
# Gradio ์ธํ„ฐํŽ˜์ด์Šค ์„ค์ • ๋ฐ ์•ฑ ์‹คํ–‰
iface = gr.Interface(fn=predict_sentiment, inputs="text", outputs="text", title="Simple Sentiment Analysis")
iface.launch()