mdj1412 commited on
Commit
f6c0686
โ€ข
1 Parent(s): f647140

Update app.py README.md

Browse files
Files changed (1) hide show
  1. app.py +39 -9
app.py CHANGED
@@ -165,8 +165,8 @@ demo = gr.Interface(builder, inputs=[gr.inputs.Dropdown(['Default', 'Eng', 'Kor'
165
  # outputs='label',
166
  title=title, description=description, examples=examples)
167
 
168
- def fn2():
169
- demo1.launch()
170
 
171
  with gr.Blocks() as demo1:
172
  gr.Markdown(
@@ -176,16 +176,46 @@ with gr.Blocks() as demo1:
176
  </h1>
177
  """)
178
 
179
- with gr.Accordion("Open for More!"):
 
 
 
 
 
 
180
  gr.Markdown(
181
  """
182
- ๋‚ด์šฉ์€ ์•„์ง ๋ฐ”๊พธ์ง€ ์•Š์•˜์Œ (ํ˜•์‹๋งŒ ์ฐธ๊ณ )
183
- ๋ฌธ์ œ์  : ํด๋ฆฌ์–ด ํด๋ฆญ์ด ์›ํ•˜๋Š”๋Œ€๋กœ ์•ˆ๋จ
184
- It is a program that classifies whether it is positive or negative by entering movie reviews. \
185
- You can choose between the Korean version and the English version. \
186
- It also provides a version called ""Default"", which determines whether it is Korean or English and predicts it.
 
 
 
 
 
 
 
 
 
 
 
187
  """)
188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  with gr.Row():
191
  with gr.Column():
@@ -200,7 +230,7 @@ with gr.Blocks() as demo1:
200
  output_3 = gr.HighlightedText(label="Analysis", combine_adjacent=False) \
201
  .style(color_map={"+++": "#CF0000", "++": "#FF3232", "+": "#FFD4D4", "---": "#0004FE", "--": "#4C47FF", "-": "#BEBDFF"})
202
 
203
- # btn2.click(fn=fn2)
204
  btn.click(fn=builder, inputs=[inputs_1, inputs_2], outputs=[output_1, output_2, output_3])
205
  gr.Examples(examples, inputs=[inputs_1, inputs_2])
206
 
 
165
  # outputs='label',
166
  title=title, description=description, examples=examples)
167
 
168
+ def fn2(a, b):
169
+ return [None, None, None]
170
 
171
  with gr.Blocks() as demo1:
172
  gr.Markdown(
 
176
  </h1>
177
  """)
178
 
179
+ gr.Markdown(
180
+ """
181
+ ํ•ด๋‹น ์‚ฌ์ดํŠธ์—์„œ๋Š” ์˜ํ™” ๋ฆฌ๋ทฐ๋ฅผ ์ž…๋ ฅํ–ˆ์„ ๋•Œ, ๊ธ์ •์ ์ธ ๋ฆฌ๋ทฐ์ธ์ง€ ๋ถ€์ •์ ์ธ ๋ฆฌ๋ทฐ์ธ์ง€ ํŒ๋ณ„ ํ•ด์ค€๋‹ค.
182
+ """)
183
+
184
+
185
+ with gr.Row():
186
  gr.Markdown(
187
  """
188
+ ### ์ž…๋ ฅ(Lang, Text)์— ๋Œ€ํ•œ ์„ค๋ช…
189
+ ๊ฐ€์šด๋ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์™ผ์ชฝ์— ์žˆ๋Š” ์นธ๋“ค์€ ์ž…๋ ฅ์— ํ•ด๋‹นํ•œ๋‹ค.
190
+ * โ€˜Langโ€™์€ ์ž์‹ ์ด ์ž…๋ ฅํ•  ์–ธ์–ด๋ฅผ ์„ ํƒํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ๊ธฐ์ž…์ด ์—†์„ ๊ฒฝ์šฐ(Default)์—๋Š” ํ•œ๊ตญ์–ด์ธ์ง€ ์˜์–ด์ธ์ง€ ์˜ค๋ฅธ์ชฝ ๋ฐ•์Šค โ€˜Langโ€™์—์„œ ํŒ๋‹จ ํ•ด์ค€๋‹ค.
191
+ * โ€˜Textโ€™๋Š” ์˜ํ™” ๋ฆฌ๋ทฐ๋ฅผ ์ž…๋ ฅํ•˜๋Š” ๊ณณ์ด๋‹ค. ์ž…๋ ฅ์„ ๋งˆ์น˜๊ณ  ์ œ์ถœํ•˜๊ธฐ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ๊ฒฐ๊ณผ๋ฅผ ๋ถ„์„ํ•  ์ˆ˜ ์žˆ๋‹ค.
192
+ """)
193
+ gr.Markdown(
194
+ """
195
+ ### ์ถœ๋ ฅ(Lang, Result, Analysis)์— ๋Œ€ํ•œ ์„ค๋ช…
196
+ ๊ฐ€์šด๋ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฅธ์ชฝ์— ์žˆ๋Š” ์นธ๋“ค์€ ์ถœ๋ ฅ์— ํ•ด๋‹นํ•œ๋‹ค.
197
+ * โ€˜Langโ€™์€ ์™ผ์ชฝ ์ž…๋ ฅ์—์„œ ์–ธ์–ด๋ฅผ ์„ ํƒํ•  ๋•Œ, ํ•œ๊ตญ์–ด๋ฅผ ์„ ํƒํ–ˆ์œผ๋ฉด 100% Kor, ์˜์–ด๋ฅผ ์„ ํƒํ–ˆ๋‹ค๋ฉด 100%% Eng ์ด๋‹ค.
198
+ ๋งŒ์•ฝ Default๋ฅผ ์„ ํƒํ–ˆ๋‹ค๋ฉด ํ•œ๊ตญ์–ด์ธ์ง€ ์˜์–ด์ธ์ง€ ํŒ๋‹จ ํ•ด์ค€๋‹ค.
199
+ ์ด ๋ฐฉ๋ฒ•์€ [ํ•ด๋‹น ์‚ฌ์ดํŠธ](https://medium.com/@c.chaitanya/language-identification-in-python-using-fasttext-60359dc30ed0)์— ์žˆ๋Š” ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ–ˆ๋‹ค.
200
+ * โ€˜Resultโ€™๋Š” ๋‘ ๋ชจ๋ธ(Kor, Eng)์„ ์ด์šฉํ•ด์„œ ๊ธ์ • ๋ฆฌ๋ทฐ ๋˜๋Š” ๋ถ€์ • ๋ฆฌ๋ทฐ๋ฅผ ํŒ๋‹จํ–ˆ๋‹ค. (๋ชจ๋ธ์— ๋Œ€ํ•ด ๋” ์•Œ๊ณ  ์‹ถ์œผ๋ฉด ๋ฐ‘์—์„œ ํ™•์ธํ•˜๊ธธ ๋ฐ”๋ž€๋‹ค.)
201
+ * โ€˜Analysisโ€™๋Š” ์ž…๋ ฅํ•œ ๋ฆฌ๋ทฐ์˜ ๊ธ์ • ๋˜๋Š” ๋ถ€์ •์„ ๊ฒฐ์ •๋  ๋•Œ, ์–ด๋–ค ๋‹จ์–ด์— ์˜ํ•ด์„œ ๊ฒฐ์ • ๋˜์—ˆ๋Š”์ง€ ๊ฐ•์กฐ ํ•ด์ค€๋‹ค.
202
+ ์ฆ‰, ์˜ํ–ฅ์„ ์ค€ ๋‹จ์–ด์— ๋Œ€ํ•ด์„œ๋Š” ์–ผ๋งˆ๋‚˜ ๊ธ์ •์ ์ธ(๋˜๋Š” ๋ถ€์ •์ ์ธ) ์˜ํ–ฅ์„ ์ฃผ์—ˆ๋Š”์ง€ ๊ฐ•์กฐ๋˜์–ด ์žˆ๋‹ค.
203
+ ( ๊ธ์ •์ธ ๊ฒฝ์šฐ ๋ถ‰์€์ƒ‰(+++, ++, +), ๋ถ€์ •์ธ ๊ฒฝ์šฐ ํŒŒ๋ž€์ƒ‰(---,--,-) )
204
  """)
205
 
206
+ with gr.Accordion("๋ชจ๋ธ์— ๋Œ€ํ•œ ์„ค๋ช…"):
207
+ gr.Markdown(
208
+ """
209
+ ' | Kor | Eng
210
+ :---:|:---:|:---:
211
+ Model Name | klue/roberta-base | bert-base-uncased
212
+ Learning Rate | 3e-05 | 5e-5
213
+ Batch Size Train | 64 | 64
214
+ Steps | 2800 | 2000
215
+ Batch Size Test | 4 | 4
216
+ Validation Accuracy | 93.55% | 95.81%
217
+ Test Accuracy | 94.0% | 92.8%
218
+ """)
219
 
220
  with gr.Row():
221
  with gr.Column():
 
230
  output_3 = gr.HighlightedText(label="Analysis", combine_adjacent=False) \
231
  .style(color_map={"+++": "#CF0000", "++": "#FF3232", "+": "#FFD4D4", "---": "#0004FE", "--": "#4C47FF", "-": "#BEBDFF"})
232
 
233
+ # btn2.click(fn=fn2, inputs=[None, None], output=[output_1, output_2, output_3])
234
  btn.click(fn=builder, inputs=[inputs_1, inputs_2], outputs=[output_1, output_2, output_3])
235
  gr.Examples(examples, inputs=[inputs_1, inputs_2])
236