Beeniebeen commited on
Commit
6922275
โ€ข
1 Parent(s): 1c8c654

Delete gradio.py

Browse files
Files changed (1) hide show
  1. gradio.py +0 -19
gradio.py DELETED
@@ -1,19 +0,0 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
-
4
- # ๊ฐ์„ฑ ๋ถ„์„ ๋ชจ๋ธ์„ ๋ถˆ๋Ÿฌ์˜ต๋‹ˆ๋‹ค.
5
- sentiment = pipeline('sentiment-analysis')
6
-
7
- def get_sentiment(input_text):
8
- # ์ž…๋ ฅ ํ…์ŠคํŠธ์˜ ๊ฐ์„ฑ์„ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค.
9
- result = sentiment(input_text)[0]
10
- label = result['label']
11
- score = result['score']
12
- return f"๊ฐ์„ฑ: {label}, ์‹ ๋ขฐ๋„: {score}"
13
-
14
- # Gradio UI๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
15
- input_text = gr.inputs.Textbox(lines=7, label="ํ…์ŠคํŠธ ์ž…๋ ฅ")
16
- output_text = gr.outputs.Textbox(label="๊ฐ์„ฑ ๋ถ„์„ ๊ฒฐ๊ณผ")
17
-
18
- # Gradio ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
19
- gr.Interface(get_sentiment, inputs=input_text, outputs=output_text).launch()