From 7f107922f83e12dac6d3c3742fd4032f765a2ec7 Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Mon, 8 Feb 2021 18:51:03 +0100 Subject: [PATCH] print_results now follow the order imposed my metrics --- UD_any/print_results.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UD_any/print_results.py b/UD_any/print_results.py index 9720cd4..e1eeb68 100755 --- a/UD_any/print_results.py +++ b/UD_any/print_results.py @@ -16,7 +16,7 @@ if __name__ == "__main__" : scoreType = scoreTypes["F1"] if len(sys.argv) < 3 else scoreTypes[sys.argv[2].upper()] - metrics = ["LAS","UAS","Tokens","Words","Sentences","UPOS","UFeats","Lemmas"] + metrics = ["Sentences","LAS","UAS","Lemmas","UFeats","UPOS","Words","Tokens"] output = [] outputByModelScore = dict() @@ -73,7 +73,7 @@ if __name__ == "__main__" : score = score.replace('-','') output.append(outputByModelScore[corpus][model][metric][0]) output[-1][2] = score - output[-1] = [output[-1][0]] + [baseScore] + output[-1][1:] + output[-1] = [output[-1][0]] + [metrics.index(output[-1][1])] + [output[-1][1]] + [baseScore] + output[-1][2:] if len(output) == 0 : print("ERROR : Output length is 0", file=sys.stderr) @@ -82,7 +82,7 @@ if __name__ == "__main__" : exit(1) output.sort() - output = [[val[0]] + val[2:] for val in output] + output = [[val[0]] + [val[2]] + val[4:] for val in output] maxColLens = [0 for _ in range(len(output[0]))] -- GitLab