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()