Spaces:
Runtime error
Runtime error
cointegrated
commited on
Commit
•
9a6ada6
1
Parent(s):
c81138b
add the field for a correct translation and the new dataset for feedback
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ MODEL_PATH_LANGID = 'lid.323.ftz'
|
|
17 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
18 |
hf_writer = gr.HuggingFaceDatasetSaver(
|
19 |
hf_token=HF_TOKEN,
|
20 |
-
dataset_name="myv-translation-2022-demo-flags",
|
21 |
organization="slone",
|
22 |
private=True,
|
23 |
)
|
@@ -158,6 +158,9 @@ Please leave your feedback about the quality of translations using the buttons w
|
|
158 |
The code and models for translation can be found in the repository: https://github.com/slone-nlp/myv-nmt.
|
159 |
"""
|
160 |
|
|
|
|
|
|
|
161 |
|
162 |
interface = gr.Interface(
|
163 |
translate_wrapper,
|
@@ -165,7 +168,7 @@ interface = gr.Interface(
|
|
165 |
gr.Textbox(label="Text / текст", lines=2, placeholder='text to translate / текст ютавтозь'),
|
166 |
gr.Dropdown(list(lang_to_code.keys()), type="value", label='source language / васенце кель', value=list(lang_to_code.keys())[0]),
|
167 |
gr.Dropdown(list(lang_to_code.keys()), type="value", label='target language / эрявикс кель', value=list(lang_to_code.keys())[1]),
|
168 |
-
|
169 |
],
|
170 |
"text",
|
171 |
allow_flagging="manual",
|
|
|
17 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
18 |
hf_writer = gr.HuggingFaceDatasetSaver(
|
19 |
hf_token=HF_TOKEN,
|
20 |
+
dataset_name="myv-translation-2022-demo-flags-v2",
|
21 |
organization="slone",
|
22 |
private=True,
|
23 |
)
|
|
|
158 |
The code and models for translation can be found in the repository: https://github.com/slone-nlp/myv-nmt.
|
159 |
"""
|
160 |
|
161 |
+
fix_instruction = 'Если перевод модели неправильный, впишите сюда правильный текст, снова нажмите "Исполнить", и затем "bad 🙁". ' \
|
162 |
+
'Тогда к нам в базу попадёт пометка, что перевод был неверным, и его исправление.'
|
163 |
+
|
164 |
|
165 |
interface = gr.Interface(
|
166 |
translate_wrapper,
|
|
|
168 |
gr.Textbox(label="Text / текст", lines=2, placeholder='text to translate / текст ютавтозь'),
|
169 |
gr.Dropdown(list(lang_to_code.keys()), type="value", label='source language / васенце кель', value=list(lang_to_code.keys())[0]),
|
170 |
gr.Dropdown(list(lang_to_code.keys()), type="value", label='target language / эрявикс кель', value=list(lang_to_code.keys())[1]),
|
171 |
+
gr.Textbox(label="Correct translation", lines=2, placeholder=fix_instruction),
|
172 |
],
|
173 |
"text",
|
174 |
allow_flagging="manual",
|