diff --git a/src/baseline/dataset.py b/src/baseline/dataset.py index 263cc43..0ab85c8 100644 --- a/src/baseline/dataset.py +++ b/src/baseline/dataset.py @@ -160,14 +160,4 @@ def parse_item(self, src, trg): inputs['d_tags'] = d_tags inputs['c_tags'] = c_tags - return inputs - - -if __name__ == '__main__': - - d = DatasetCTC(in_model_dir='pretrained_model/chinese-roberta-wwm-ext', - src_texts=['可老爸还是无动于束'], - trg_texts=['可老爸还是无动于衷']) - dataset = torch.utils.data.dataloader.DataLoader(d, batch_size=1) - for i in dataset: - print(i) + return inputs \ No newline at end of file diff --git a/src/evaluate.py b/src/evaluate.py index 296a6fd..49387e5 100644 --- a/src/evaluate.py +++ b/src/evaluate.py @@ -21,13 +21,4 @@ def evaluate(in_model_dir,json_data_file, log_fp='logs/f1_score.log'): trg_texts=trg_texts, log_fp=log_fp) - return f1_score - - -if __name__ == '__main__': - - evaluate( - in_model_dir='model/ctc_train_2022Y04M27D16H/epoch4,step1,testf1_45_3%,devf1_23_53%', - json_data_file='data/preliminary_data/preliminary_val.json', - ) - \ No newline at end of file + return f1_score \ No newline at end of file diff --git a/src/prepare_for_upload.py b/src/prepare_for_upload.py index 7e725a6..4ac47a7 100644 --- a/src/prepare_for_upload.py +++ b/src/prepare_for_upload.py @@ -15,14 +15,3 @@ def prepare_for_uploadfile(in_model_dir, out_json_file = open(out_json_file, 'w', encoding='utf-8') json.dump(output_json_data, out_json_file, ensure_ascii=False, indent=4) - - - - - -if __name__ == '__main__': - prepare_for_uploadfile( - in_model_dir='model/model/ctc_train_2022Y04M27D16H/epoch2,step11,testf1_46_37%,devf1_26_66%', - in_json_file='data/preliminary_data/preliminary_b_test_source.json', - out_json_file='data/preliminary_b_test_inference.json' - ) \ No newline at end of file