gsarti commited on
Commit
1f483bd
1 Parent(s): 2e7caf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- edits_reverse = edits_reverse + " " * (len(aligned_edit.split("\\n")[0]) - len(edits_reverse))
 
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)