-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the compute_overall.py script and the example data for deepsee…
…k model
- Loading branch information
1 parent
a32badb
commit 5eca479
Showing
5 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import argparse | ||
import numpy as np | ||
import math | ||
|
||
|
||
'''This script computes the overall score for the objective and subjective evaluations''' | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--mode", help="must be obj or sub, representing the objective and subjective evaluation", default='obj') | ||
parser.add_argument("--feedback_overall", help="the overall score of feedback dimension", default=math.inf, type=float) | ||
parser.add_argument("--comp_feedback_overall", help="the overall score of comparison dimension", default=math.inf, type=float) | ||
parser.add_argument("--correction_overall", help="the overall score of correction dimension", default=math.inf, type=float) | ||
parser.add_argument("--meta_feedback_overall", help="the overall score of meta-feedback dimension", default=math.inf, type=float) | ||
args = parser.parse_args() | ||
|
||
|
||
def normalize(score): | ||
# normlize the corrections for objective evaluation | ||
return (score + 100) / 2 | ||
|
||
|
||
if __name__ == "__main__": | ||
scores = [] | ||
for index, score in enumerate([ | ||
args.feedback_overall, | ||
args.comp_feedback_overall, | ||
args.correction_overall, | ||
args.meta_feedback_overall | ||
]): | ||
if score != math.inf: | ||
if args.mode == 'obj' and index in [0, 3]: | ||
score = normalize(score) | ||
scores.append(score) | ||
print(scores) | ||
|
||
assert len(scores) > 0, 'No valid scores' | ||
print('Overall Scores:', round(np.mean(scores), 4)) |
Binary file not shown.
Binary file not shown.