jisukim8873
commited on
Commit
•
5a31d97
1
Parent(s):
598e486
finish!
Browse files
app.py
CHANGED
@@ -77,35 +77,28 @@ def conversion(source, text):
|
|
77 |
|
78 |
return generated_text
|
79 |
|
80 |
-
title = 'KoTAN Translator & Speech-style converter'
|
81 |
lang = ['English','Korean']
|
82 |
style = ['formal', 'informal', 'android', 'azae', 'chat', 'choding', 'emoticon', 'enfp', \
|
83 |
'gentle', 'halbae', 'halmae', 'joongding', 'king', 'naruto', 'seonbi', 'sosim', 'translator']
|
84 |
|
85 |
-
with gr.Blocks() as demo:
|
86 |
-
gr.Markdown("KoTAN: Korean Translation and Augmentation with fine-tuned NLLB. You can exercise translation tasks, and speech-style conversion. \
|
87 |
-
If you want to download as pip package, please visit our github. (https://github.com/KoJLabs/KoTAN)")
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
# # article='Jisu, Kim. Juhwan, Lee',
|
97 |
-
# enable_queue=True,
|
98 |
-
# )
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
)
|
110 |
|
111 |
demo.launch()
|
|
|
77 |
|
78 |
return generated_text
|
79 |
|
80 |
+
title = 'KoTAN Translator & Speech-style converter. If you want to download as pip package, please visit our github. (https://github.com/KoJLabs/KoTAN)'
|
81 |
lang = ['English','Korean']
|
82 |
style = ['formal', 'informal', 'android', 'azae', 'chat', 'choding', 'emoticon', 'enfp', \
|
83 |
'gentle', 'halbae', 'halmae', 'joongding', 'king', 'naruto', 'seonbi', 'sosim', 'translator']
|
84 |
|
|
|
|
|
|
|
85 |
|
86 |
+
translator_app = gr.Interface(
|
87 |
+
fn=translate,
|
88 |
+
inputs=[gr.inputs.Dropdown(choices=lang, label='Source Language'), gr.inputs.Dropdown(choices=lang, label='Target Language'), gr.inputs.Textbox(lines=5, label='Text to Translate')],
|
89 |
+
outputs=[gr.outputs.Textbox(label='Translated Text')],
|
90 |
+
title=title,
|
91 |
+
enable_queue=True,
|
92 |
+
)
|
|
|
|
|
|
|
93 |
|
94 |
+
conversion_app = gr.Interface(
|
95 |
+
fn=conversion,
|
96 |
+
inputs=[gr.inputs.Dropdown(choices=style, label='Speech Style'), gr.inputs.Textbox(lines=5, label='Text to style conversion')],
|
97 |
+
outputs=[gr.outputs.Textbox(label='Converted Text')],
|
98 |
+
title=title,
|
99 |
+
enable_queue=True,
|
100 |
+
)
|
101 |
+
|
102 |
+
demo = gr.TabbedInterface([translator_app, conversion_app], ["Translator", "Speech Style converter"])
|
|
|
103 |
|
104 |
demo.launch()
|