Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,22 +7,11 @@ sentiment = pipeline("sentiment-analysis")
|
|
7 |
# ์ฌ์ฉ์ ์
๋ ฅ์ ๋ํ ๊ฐ์ฑ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํ๋ ํจ์
|
8 |
def get_sentiment(์
๋ ฅ):
|
9 |
# ๊ฐ์ฑ ๋ถ์ ์คํ
|
10 |
-
|
11 |
-
# ๊ฒฐ๊ณผ ํฌ๋งทํ
๋ฐ ๋ฐํ
|
12 |
-
return result[0]
|
13 |
|
14 |
-
# Gradio ์ฑ ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
15 |
-
iface = gr.Interface(
|
16 |
-
fn=get_sentiment, # ์คํํ ํจ์
|
17 |
-
inputs=gr.inputs.Textbox(lines=2, placeholder="์ฌ๊ธฐ์ ํ
์คํธ๋ฅผ ์
๋ ฅํ์ธ์..."), # ์
๋ ฅ๋ ์ค์
|
18 |
-
outputs="json", # ์ถ๋ ฅ ํํ
|
19 |
-
clear_on_submit=True, # ์ ์ถ ํ ์
๋ ฅ๋ ํด๋ฆฌ์ด
|
20 |
-
title="ํ
์คํธ ๊ฐ์ฑ ๋ถ์", # UI ์ ๋ชฉ
|
21 |
-
description="ํ
์คํธ๋ฅผ ์
๋ ฅํ๊ณ ์ ์ถ ๋ฒํผ์ ํด๋ฆญํ์ฌ ๊ฐ์ฑ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ์ธ์." # UI ์ค๋ช
|
22 |
-
)
|
23 |
|
24 |
-
|
25 |
-
|
26 |
|
27 |
# import gradio as gr
|
28 |
# from transformers import pipeline
|
|
|
7 |
# ์ฌ์ฉ์ ์
๋ ฅ์ ๋ํ ๊ฐ์ฑ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํ๋ ํจ์
|
8 |
def get_sentiment(์
๋ ฅ):
|
9 |
# ๊ฐ์ฑ ๋ถ์ ์คํ
|
10 |
+
return sentiment(์
๋ ฅ)
|
|
|
|
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
gr.Interface(fn=ask_question, inputs="์
๋ ฅ", outputs="output", title="Sentiment Analysis", description="").launch()
|
14 |
+
|
15 |
|
16 |
# import gradio as gr
|
17 |
# from transformers import pipeline
|