gabrielwithhappy commited on
Commit
efa08c7
โ€ข
1 Parent(s): 9e57c35

add card view to update a summary

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -71,28 +71,27 @@ title = "๊ท ํ˜•์žกํžŒ ๋‰ด์Šค ์ฝ๊ธฐ (Balanced News Reading)"
71
 
72
  with gr.Blocks() as demo:
73
  news = news_collector()
 
74
 
75
- gr.Markdown(
76
- """
77
- # ๊ท ํ˜•์žกํžŒ ๋‰ด์Šค ์ฝ๊ธฐ (Balanced News Reading)
78
-
79
- ๊ธ์ •์ ์ธ ๊ธฐ์‚ฌ์™€ ๋ถ€์ •์ ์ธ ๊ธฐ์‚ฌ์ธ์ง€ ํ™•์ธํ•˜์—ฌ ๋‰ด์Šค๋ฅผ ์ฝ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ ๊ฒฝ์ œ๋‰ด์Šค๊ธฐ์‚ฌ๋ฅผ ๊ฐ€์ ธ์™€ Example์—์„œ ๋ฐ”๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
80
-
81
- ## ์‚ฌ์šฉ๋ฐฉ๋ฒ•
82
- Daum๋‰ด์Šค์˜ ๊ฒฝ์ œ ๊ธฐ์‚ฌ๋ฅผ ๊ฐ€์ ธ์™€ ๋‚ด์šฉ์„ ์š”์•ฝํ•˜๊ณ  `Example`์— ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ๊ฐ์ • ๋ถ„์„์„ ํ•˜๊ณ  ์‹ถ์€ ๊ธฐ์‚ฌ๋ฅผ `Examples`์—์„œ ์„ ํƒํ•ด์„œ `Submit`์„ ๋ˆ„๋ฅด๋ฉด `Classification`์—
83
- ํ•ด๋‹น ๊ธฐ์‚ฌ์˜ ๊ฐ์ • ํ‰๊ฐ€ ๊ฒฐ๊ณผ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
84
 
85
- ๊ฐ์ •ํ‰๊ฐ€๋Š” ๊ฐ ์ƒํƒœ์˜ ํ™•๋ฅ  ์ •๋ณด๊ฐ€ `neutral`, `positive`, `negative` 3๊ฐ€์ง€๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค.
86
 
87
- ## ๊ตฌ์กฐ ์„ค๋ช…
88
- ๋‰ด์Šค๊ธฐ์‚ฌ๋ฅผ ํฌ๋กค๋ง ๋ฐ ์š”์•ฝ ๋ชจ๋ธ์„ ์ด์šฉํ•œ ๊ธฐ์‚ฌ ์š”์•ฝ -> ๊ธฐ์‚ฌ ์š”์•ฝ์ •๋ณด Example์— ์ถ”๊ฐ€ -> ํ•œ๊ตญ์–ด fine-tunningํ•œ ๊ฐ์ •ํ‰๊ฐ€ ๋ชจ๋ธ์„ ์ด์šฉํ•œ ๊ฐ์ •ใ…ใ…‡๊ฐ€
 
89
 
90
- """)
91
- news.update_news_examples()
 
92
 
93
- gr.load("models/gabrielyang/finance_news_classifier-KR_v7",
94
- inputs = gr.Textbox( placeholder="๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”." ),
95
- examples=news.examples)
 
96
 
97
 
98
 
 
71
 
72
  with gr.Blocks() as demo:
73
  news = news_collector()
74
+ news.update_news_examples()
75
 
76
+ with gr.Tab("์†Œ๊ฐœ"):
77
+ gr.Markdown(
78
+ """
79
+ # ๊ท ํ˜•์žกํžŒ ๋‰ด์Šค ์ฝ๊ธฐ (Balanced News Reading)
 
 
 
 
 
80
 
81
+ ๊ธ์ •์ ์ธ ๊ธฐ์‚ฌ์™€ ๋ถ€์ •์ ์ธ ๊ธฐ์‚ฌ์ธ์ง€ ํ™•์ธํ•˜์—ฌ ๋‰ด์Šค๋ฅผ ์ฝ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ ๊ฒฝ์ œ๋‰ด์Šค๊ธฐ์‚ฌ๋ฅผ ๊ฐ€์ ธ์™€ Example์—์„œ ๋ฐ”๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
82
 
83
+ ## 1. ์‚ฌ์šฉ๋ฐฉ๋ฒ•
84
+ Daum๋‰ด์Šค์˜ ๊ฒฝ์ œ ๊ธฐ์‚ฌ๋ฅผ ๊ฐ€์ ธ์™€ ๋‚ด์šฉ์„ ์š”์•ฝํ•˜๊ณ  `Example`์— ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ๊ฐ์ • ๋ถ„์„์„ ํ•˜๊ณ  ์‹ถ์€ ๊ธฐ์‚ฌ๋ฅผ `Examples`์—์„œ ์„ ํƒํ•ด์„œ `Submit`์„ ๋ˆ„๋ฅด๋ฉด `Classification`์—
85
+ ํ•ด๋‹น ๊ธฐ์‚ฌ์˜ ๊ฐ์ • ํ‰๊ฐ€ ๊ฒฐ๊ณผ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ๊ฐ์ •ํ‰๊ฐ€๋Š” ๊ฐ ์ƒํƒœ์˜ ํ™•๋ฅ  ์ •๋ณด์™€ ํ•จ๊ป˜ `neutral`, `positive`, `negative` 3๊ฐ€์ง€๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
86
 
87
+ ## 2. ๊ตฌ์กฐ ์„ค๋ช…
88
+ ๋‰ด์Šค๊ธฐ์‚ฌ๋ฅผ ํฌ๋กค๋ง ๋ฐ ์š”์•ฝ ๋ชจ๋ธ์„ ์ด์šฉํ•œ ๊ธฐ์‚ฌ ์š”์•ฝ >> ๊ธฐ์‚ฌ ์š”์•ฝ์ •๋ณด Example์— ์ถ”๊ฐ€ >> ํ•œ๊ตญ์–ด fine-tunningํ•œ ๊ฐ์ •ํ‰๊ฐ€ ๋ชจ๋ธ์„ ์ด์šฉํ•ด ์ž…๋ ฅ๋œ ๊ธฐ์‚ฌ์— ๋Œ€ํ•œ ๊ฐ์ • ํ‰๊ฐ€ ์ง„ํ–‰
89
+ """)
90
 
91
+ with gr.Tab("๋ฐ๋ชจ"):
92
+ gr.load("models/gabrielyang/finance_news_classifier-KR_v7",
93
+ inputs = gr.Textbox( placeholder="๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”." ),
94
+ examples=news.examples)
95
 
96
 
97