Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -219,27 +219,37 @@ DEMO_EXPLANATION = """
|
|
219 |
2. **錯誤標註**
|
220 |
- 發現翻譯錯誤時,將錯誤部分標註到「錯誤區間」欄位,錯誤需連接成最長可能區間,若中間有正確翻譯,需分段標註,避免連續標記。
|
221 |
- 若有多處錯誤,可逐一標註並點擊「保存並繼續標記當前資料」後繼續修正。
|
222 |
-
-
|
223 |
-
|
|
|
224 |
- 標記完所有錯誤區間以後,對每個翻譯文本的整體品質進行評分 (0-100分,0分最差,100分最好)。
|
225 |
- 0:幾乎沒有保留原文意思,大部分資訊遺失。
|
226 |
- 33:保留部分原文意思,但有明顯遺漏,敘述難以理解,文法可能很差。
|
227 |
- 66:保留大部分原文意思,有一些文法錯誤或輕微不一致。
|
228 |
- 100:原文意思和文法完全正確。
|
229 |
-
(即使選擇
|
230 |
"""
|
231 |
|
232 |
with gr.Blocks(css="""
|
233 |
#correct_button {
|
234 |
background-color: #4CAF50;
|
235 |
color: white;
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
#too_many_errors_button {
|
238 |
background-color: #f44336;
|
239 |
color: white;
|
|
|
|
|
|
|
|
|
240 |
}
|
241 |
""") as demo:
|
242 |
gr.Markdown(DEMO_EXPLANATION)
|
|
|
243 |
|
244 |
with gr.Tab("標記工具"):
|
245 |
with gr.Row():
|
@@ -254,18 +264,18 @@ with gr.Blocks(css="""
|
|
254 |
target = gr.Textbox(label="翻譯文本", lines=15, interactive=False)
|
255 |
|
256 |
with gr.Row(variant='panel', equal_height=True):
|
257 |
-
with gr.Column(scale=
|
258 |
error_span = gr.Textbox(label="錯誤區間 (💡可以直接複製「翻譯文本」欄位,並在此貼上)", lines=6, placeholder="請輸入翻譯中文本的錯誤區間 (如無錯誤則不需)")
|
259 |
with gr.Column(scale=1):
|
260 |
correct_button = gr.Button("✔ 完全正確", elem_id="correct_button")
|
261 |
too_many_errors_button = gr.Button("✖ 過多錯誤", elem_id="too_many_errors_button")
|
262 |
-
with gr.Column(scale=
|
263 |
with gr.Row(equal_height=True):
|
264 |
category = gr.Dropdown(label="錯誤類別", choices=list(categories.keys()), value="Accuracy")
|
265 |
subcategory = gr.Dropdown(label="子類別", choices=categories["Accuracy"], value="Mistranslation")
|
266 |
other = gr.Textbox(label="其他子類別", placeholder="若無法歸類,請填寫其他")
|
267 |
with gr.Row(equal_height=True):
|
268 |
-
severity = gr.Radio(label="錯誤嚴重程度", choices=
|
269 |
save_current_button = gr.Button("保存並繼續標記當前資料")
|
270 |
|
271 |
with gr.Row(variant='panel', equal_height=True):
|
|
|
219 |
2. **錯誤標註**
|
220 |
- 發現翻譯錯誤時,將錯誤部分標註到「錯誤區間」欄位,錯誤需連接成最長可能區間,若中間有正確翻譯,需分段標註,避免連續標記。
|
221 |
- 若有多處錯誤,可逐一標註並點擊「保存並繼續標記當前資料」後繼續修正。
|
222 |
+
- 若錯誤超過五處,直接按下「過多錯誤」按鈕,再進行後續的評分。
|
223 |
+
- 若無錯誤,直接按下「完全正確」按鈕,再進行後續的評分。
|
224 |
+
3. **評分**
|
225 |
- 標記完所有錯誤區間以後,對每個翻譯文本的整體品質進行評分 (0-100分,0分最差,100分最好)。
|
226 |
- 0:幾乎沒有保留原文意思,大部分資訊遺失。
|
227 |
- 33:保留部分原文意思,但有明顯遺漏,敘述難以理解,文法可能很差。
|
228 |
- 66:保留大部分原文意思,有一些文法錯誤或輕微不一致。
|
229 |
- 100:原文意思和文法完全正確。
|
230 |
+
(即使選擇 **「完全正確」**,分數也不一定需要評100分)
|
231 |
"""
|
232 |
|
233 |
with gr.Blocks(css="""
|
234 |
#correct_button {
|
235 |
background-color: #4CAF50;
|
236 |
color: white;
|
237 |
+
font-size: 12px;
|
238 |
+
padding: 5px 10px;
|
239 |
+
border-radius: 5px;
|
240 |
+
min-height: 0px;
|
241 |
}
|
242 |
#too_many_errors_button {
|
243 |
background-color: #f44336;
|
244 |
color: white;
|
245 |
+
font-size: 12px;
|
246 |
+
padding: 5px 10px;
|
247 |
+
border-radius: 5px;
|
248 |
+
min-height: 0px;
|
249 |
}
|
250 |
""") as demo:
|
251 |
gr.Markdown(DEMO_EXPLANATION)
|
252 |
+
|
253 |
|
254 |
with gr.Tab("標記工具"):
|
255 |
with gr.Row():
|
|
|
264 |
target = gr.Textbox(label="翻譯文本", lines=15, interactive=False)
|
265 |
|
266 |
with gr.Row(variant='panel', equal_height=True):
|
267 |
+
with gr.Column(scale=2):
|
268 |
error_span = gr.Textbox(label="錯誤區間 (💡可以直接複製「翻譯文本」欄位,並在此貼上)", lines=6, placeholder="請輸入翻譯中文本的錯誤區間 (如無錯誤則不需)")
|
269 |
with gr.Column(scale=1):
|
270 |
correct_button = gr.Button("✔ 完全正確", elem_id="correct_button")
|
271 |
too_many_errors_button = gr.Button("✖ 過多錯誤", elem_id="too_many_errors_button")
|
272 |
+
with gr.Column(scale=2):
|
273 |
with gr.Row(equal_height=True):
|
274 |
category = gr.Dropdown(label="錯誤類別", choices=list(categories.keys()), value="Accuracy")
|
275 |
subcategory = gr.Dropdown(label="子類別", choices=categories["Accuracy"], value="Mistranslation")
|
276 |
other = gr.Textbox(label="其他子類別", placeholder="若無法歸類,請填寫其他")
|
277 |
with gr.Row(equal_height=True):
|
278 |
+
severity = gr.Radio(label="錯誤嚴重程度", choices=severity_choices, value="Minor")
|
279 |
save_current_button = gr.Button("保存並繼續標記當前資料")
|
280 |
|
281 |
with gr.Row(variant='panel', equal_height=True):
|