Skip to content
Snippets Groups Projects
Commit 7f107922 authored by Franck Dary's avatar Franck Dary
Browse files

print_results now follow the order imposed my metrics

parent 149437ab
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ if __name__ == "__main__" : ...@@ -16,7 +16,7 @@ if __name__ == "__main__" :
scoreType = scoreTypes["F1"] if len(sys.argv) < 3 else scoreTypes[sys.argv[2].upper()] 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 = [] output = []
outputByModelScore = dict() outputByModelScore = dict()
...@@ -73,7 +73,7 @@ if __name__ == "__main__" : ...@@ -73,7 +73,7 @@ if __name__ == "__main__" :
score = score.replace('-','') score = score.replace('-','')
output.append(outputByModelScore[corpus][model][metric][0]) output.append(outputByModelScore[corpus][model][metric][0])
output[-1][2] = score 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 : if len(output) == 0 :
print("ERROR : Output length is 0", file=sys.stderr) print("ERROR : Output length is 0", file=sys.stderr)
...@@ -82,7 +82,7 @@ if __name__ == "__main__" : ...@@ -82,7 +82,7 @@ if __name__ == "__main__" :
exit(1) exit(1)
output.sort() 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]))] maxColLens = [0 for _ in range(len(output[0]))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment