import gradio as gr from transformers import pipeline # Sentiment analysis pipeline 생성 sentiment = pipeline("sentiment-analysis") def get_sentiment(입력): return sentiment(입력) # Gradio 인터페이스 설정 interface = gr.Interface( fn=get_sentiment, # 호출될 함수 inputs="text", # 입력란 설정 outputs="text", # 출력 형식 title="Sentiment Analysis", # UI 제목 description="이 앱은 입력된 텍스트의 감성을 분석합니다. 긍정적이거나 부정적인 결과를 보여줍니다.", # UI 설명 examples=[["이 제품은 정말 좋습니다!"], ["제 기대에 못 미쳤어요."]], # 예시 입력 theme="default", # UI 테마 layout="vertical" # UI 레이아웃 ) # Gradio 앱 실행 interface.launch() # gr.Interface(fn=ask_question, inputs="text", outputs="text", title="KoAlpaca-355M", description="한국어로 질문하세요.").launch()