File size: 409 Bytes
f02bc62
dcea58a
f02bc62
dcea58a
 
f02bc62
dcea58a
 
 
f02bc62
dcea58a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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()