Update app.py README.md
Browse files
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 |
-
|
170 |
|
171 |
with gr.Blocks() as demo1:
|
172 |
gr.Markdown(
|
@@ -176,16 +176,46 @@ with gr.Blocks() as demo1:
|
|
176 |
</h1>
|
177 |
""")
|
178 |
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
gr.Markdown(
|
181 |
"""
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|