Spaces:
Runtime error
Runtime error
File size: 934 Bytes
f4807cc 0200696 f4807cc 0200696 5dae49c 0200696 5dae49c 0200696 4ea9451 0200696 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
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() |