diff --git a/src/metric.py b/src/metric.py index 45ec335..931d7ad 100644 --- a/src/metric.py +++ b/src/metric.py @@ -132,10 +132,9 @@ def compute_detect_correct_label_list(src_text, trg_text): correct_ref_list.append((src_i, trg_token)) elif tag == 'delete': - for count, src_i in enumerate(range(src_i1, src_i2)): - trg_token = '' - detect_ref_list.append(src_i) - correct_ref_list.append((src_i, trg_token)) + trg_token = 'D'*(src_i2-src_i1) + detect_ref_list.append(src_i1) + correct_ref_list.append((src_i1, trg_token)) elif tag == 'insert': trg_token = trg_text[trg_i1:trg_i2] @@ -220,4 +219,4 @@ def final_f1_score(src_texts, json.dump(json_data, _log_fp, indent=4) logger.info('final f1:{}'.format(final_f1)) logger.info('f1 logfile saved at:{}'.format(log_fp)) - return final_f1 + return final_f1 \ No newline at end of file