Skip to content
Snippets Groups Projects
Commit 080e57df authored by Dipam Chakraborty's avatar Dipam Chakraborty
Browse files

Fix instruction check

parent 04c8b4df
No related branches found
No related tags found
No related merge requests found
...@@ -117,14 +117,14 @@ def evaluate(LocalEvalConfig): ...@@ -117,14 +117,14 @@ def evaluate(LocalEvalConfig):
index=instructions_df.InputInstructionWithGameID).to_dict() index=instructions_df.InputInstructionWithGameID).to_dict()
cpreds, cgt = [], [] cpreds, cgt = [], []
for instructionWithGameID, instruction_is_clear in classifier_gt.items(): for instructionWithGameID, instruction_is_clear in classifier_gt.items():
cgt.append(int(instruction_is_clear.lower() == 'yes')) cgt.append(int(instruction_is_clear.lower() == 'no'))
pred = classifer_preds.get(instructionWithGameID, None) pred = classifer_preds.get(instructionWithGameID, None)
if pred is not None: if pred is not None:
cpreds.append(pred) cpreds.append(pred)
else: else:
warnings.warn(f"No prediction for instruction + game id {instructionWithGameID}") warnings.warn(f"No prediction for instruction + game id {instructionWithGameID}")
# if any instruction is not predicted, default value will be taken as 1 # if any instruction is not predicted, default value will be taken as 1
cpred.append(1) cpred.append(0)
clariq_f1_score = f1_score(y_true=cgt, y_pred=cpreds, average='macro') clariq_f1_score = f1_score(y_true=cgt, y_pred=cpreds, average='macro')
...@@ -158,4 +158,4 @@ if __name__ == "__main__": ...@@ -158,4 +158,4 @@ if __name__ == "__main__":
RANKER_RESULTS_FILE = './local-eval-ranker-results.json' RANKER_RESULTS_FILE = './local-eval-ranker-results.json'
DATA_FOLDER = './public_data' DATA_FOLDER = './public_data'
evaluate(LocalEvalConfig) evaluate(LocalEvalConfig)
\ No newline at end of file
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