From 3c6dd370765bd8290ad8c3c19943a916542b1371 Mon Sep 17 00:00:00 2001 From: Xlxw Date: Mon, 6 Mar 2023 19:21:50 +0800 Subject: [PATCH] Update code for Issue #10 --- model/STG-correction/utils/__init__.py | 3 ++- model/STG-correction/utils/data_utils.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/model/STG-correction/utils/__init__.py b/model/STG-correction/utils/__init__.py index 9701caf..0271657 100644 --- a/model/STG-correction/utils/__init__.py +++ b/model/STG-correction/utils/__init__.py @@ -16,6 +16,7 @@ from utils.data_utils import data_filter, reconstruct_switch, reconstruct_tagger, joint_report, map_unk2word, reconstruct_tagger_V2, fillin_tokens, report_pipeline_output, extract_generate_tokens, fillin_tokens4gts from utils.data_utils import output_type_report from utils.convertor import PointConverter, TaggerConverter +from utils.data_utils import obtain_uuid, convert_spmap_sw, convert_spmap2tokens, convert_spmap_tg AttnMask = SelfAttentionMask() @@ -26,4 +27,4 @@ "tagger2generator", "export_generator", "fillin_tokens", "report_pipeline_output", "extract_generate_tokens", "fillin_tokens4gts", "data_filter", "reconstruct_switch", "reconstruct_tagger", "joint_report", "map_unk2word", "reconstruct_tagger_V2", "TaggerMetricV2", - "output_type_report"] \ No newline at end of file + "output_type_report", "obtain_uuid", "convert_spmap_sw", "convert_spmap2tokens", "convert_spmap_tg"] \ No newline at end of file diff --git a/model/STG-correction/utils/data_utils.py b/model/STG-correction/utils/data_utils.py index 8cf6cc4..9674e34 100644 --- a/model/STG-correction/utils/data_utils.py +++ b/model/STG-correction/utils/data_utils.py @@ -436,8 +436,6 @@ def convert_spmap_tg(sp_map : list, tg_mapper : list) -> list: return new_spmap def convert_spmap2tokens(tokens : list, sp_maps : dict): - if 'led' in tokens: - print() if not sp_maps: return tokens for i,x in enumerate(tokens): if i in sp_maps: tokens[i] = sp_maps[i]