Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 12, 2022
1 parent 2a8c67d commit 7d59352
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
12 changes: 1 addition & 11 deletions src/baseline/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 1 addition & 10 deletions src/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)

return f1_score
11 changes: 0 additions & 11 deletions src/prepare_for_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

0 comments on commit 7d59352

Please sign in to comment.