Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -91,7 +91,8 @@ for lang in langs:
|
|
91 |
aligned_edit = dic["aligned_edit"]
|
92 |
if lang == 'ara' and len(dic["aligned_edit"].split("EVAL: ")) == 2:
|
93 |
edits_reverse = aligned_edit.split("EVAL: ")[1]
|
94 |
-
|
|
|
95 |
aligned_edit = aligned_edit.split("EVAL: ")[0] + "EVAL: " + edits_reverse[::-1]
|
96 |
aligned_edit = aligned_edit.replace("\\n", "\n").replace("REF:", "MT :").replace("HYP:", "PE :")
|
97 |
st.text(aligned_edit)
|
|
|
91 |
aligned_edit = dic["aligned_edit"]
|
92 |
if lang == 'ara' and len(dic["aligned_edit"].split("EVAL: ")) == 2:
|
93 |
edits_reverse = aligned_edit.split("EVAL: ")[1]
|
94 |
+
# - 4 is a hack that makes things aligned most of the time, grounded in empirical observation only
|
95 |
+
edits_reverse = edits_reverse + " " * ((len(aligned_edit.split("\\n")[0]) - len(edits_reverse)) - 4)
|
96 |
aligned_edit = aligned_edit.split("EVAL: ")[0] + "EVAL: " + edits_reverse[::-1]
|
97 |
aligned_edit = aligned_edit.replace("\\n", "\n").replace("REF:", "MT :").replace("HYP:", "PE :")
|
98 |
st.text(aligned_edit)
|