350016z commited on
Commit
b749d65
·
verified ·
1 Parent(s): 4684792

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -114,6 +114,8 @@ if not os.path.exists(data_path):
114
  exit()
115
 
116
  data = pd.read_csv(data_path, dtype={"id": "Int64"})
 
 
117
  current_index = 0
118
  current_errors = []
119
 
@@ -345,7 +347,7 @@ def save_and_next(source, target, score, rater_selector, alternative_translation
345
  )
346
 
347
  next_source, next_target = get_current_text()
348
- status_msg = f"已提交!目前進度:第 {current_index} 筆 / 共 {len(data)} 筆。"
349
 
350
  highlighted_next = highlight_errors_in_text(next_target, current_errors)
351
  return (
 
114
  exit()
115
 
116
  data = pd.read_csv(data_path, dtype={"id": "Int64"})
117
+ # 先按照 id 由小到大排序,並重新整理索引
118
+ data = data.sort_values(by="id", ascending=True, ignore_index=True)
119
  current_index = 0
120
  current_errors = []
121
 
 
347
  )
348
 
349
  next_source, next_target = get_current_text()
350
+ status_msg = f"已提交!目前進度:第 {current_index} 筆 (id={current_index-1}) / 共 {len(data)} 筆。"
351
 
352
  highlighted_next = highlight_errors_in_text(next_target, current_errors)
353
  return (