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

Improved print_results.py: number of digits of standard deviation now matches score's

parent b77fcb76
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,9 @@ if __name__ == "__main__" : ...@@ -14,10 +14,9 @@ if __name__ == "__main__" :
"L2" : ["L2","",-2,"%.2f"], "L2" : ["L2","",-2,"%.2f"],
} }
scoreType = scoreTypes["L1"] 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 = ["LAS","UAS","Tokens","Words","Sentences","UPOS","UFeats","Lemmas"]
metrics = ["TOTAL_FIXATION_DURATION"]
output = [] output = []
outputByModelScore = dict() outputByModelScore = dict()
...@@ -66,8 +65,8 @@ if __name__ == "__main__" : ...@@ -66,8 +65,8 @@ if __name__ == "__main__" :
standardDeviation /= len(outputByModelScore[corpus][model][metric]) standardDeviation /= len(outputByModelScore[corpus][model][metric])
standardDeviation = math.sqrt(standardDeviation) standardDeviation = math.sqrt(standardDeviation)
baseScore = score baseScore = score
if float("%.2f"%standardDeviation) > 0 : if float(scoreType[3]%standardDeviation) > 0 :
score = "%s[±%%.2f]%%s"%scoreType[3]%(score,standardDeviation,scoreType[1]) score = "%s[±%s]%%s"%(scoreType[3],scoreType[3])%(score,standardDeviation,scoreType[1])
else : else :
score = "%s%%s"%scoreType[3]%(score, scoreType[1]) score = "%s%%s"%scoreType[3]%(score, scoreType[1])
if '-' in score : if '-' in score :
......
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