config changes

This commit is contained in:
s444415 2022-12-16 14:16:46 +00:00
parent 8ccd1aabb6
commit b7296bb2a9
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,8 @@
pretrained_processor_path: "Zombely/plwiki-proto-fine-tuned-v2" pretrained_processor_path: "naver-clova-ix/donut-proto"
pretrained_model_path: "Zombely/plwiki-proto-fine-tuned-v2" pretrained_model_path: "naver-clova-ix/donut-proto"
validation_dataset_path: "Zombely/diachronia-ocr" validation_dataset_path: "Zombely/diachronia-ocr"
validation_dataset_split: "train" validation_dataset_split: "train"
has_metadata: False has_metadata: False
print_output: True print_output: True
output_file_dir: "../../gonito-outs" output_file_dir: "../../gonito-outs"
test_name: "proto-test"

View File

@ -63,7 +63,7 @@ def main(config):
output_list.append(seq) output_list.append(seq)
if config.output_file_dir: if config.output_file_dir:
df = pd.DataFrame(map(lambda x: x.get('text_sequence', ''), output_list)) df = pd.DataFrame(map(lambda x: x.get('text_sequence', ''), output_list))
df.to_csv(f'{config.output_file_dir}/{config.pretrained_processor_path}-out.tsv', sep='\t', header=False, index=False) df.to_csv(f'{config.output_file_dir}/{config.test_name}-out.tsv', sep='\t', header=False, index=False)
if config.has_metadata: if config.has_metadata:
scores = {"accuracies": accs, "mean_accuracy": np.mean(accs)} scores = {"accuracies": accs, "mean_accuracy": np.mean(accs)}
@ -77,4 +77,4 @@ if __name__ == "__main__":
config = Config(args.config) config = Config(args.config)
config.argv_update(left_argv) config.argv_update(left_argv)
main(config) main(config)