Skip to content

Commit

Permalink
renamed should_export_csv to should_export_explanation_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-badlani committed Oct 5, 2024
1 parent 75b9eb9 commit 2d20206
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/algorithm/evaluation/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def __init__(
self.draw_question_verdicts,
self.draw_score,
self.should_explain_scoring,
self.should_export_csv,
self.should_export_explanation_csv,
) = map(
outputs_configuration.get,
[
Expand All @@ -467,7 +467,7 @@ def __init__(
"draw_question_verdicts",
"draw_score",
"should_explain_scoring",
"should_export_csv",
"should_export_explanation_csv",
],
)
if self.draw_question_verdicts["enabled"]:
Expand Down Expand Up @@ -997,7 +997,6 @@ def conditionally_add_explanation(
]
self.explanation_table.add_row(*row)


@staticmethod
def get_schema_verdict(answer_type, question_verdict, delta=None):
# Note: Negative custom weights should be considered as incorrect schema verdict(special case)
Expand All @@ -1017,8 +1016,8 @@ def conditionally_print_explanation(self):
def get_should_explain_scoring(self):
return self.should_explain_scoring

def get_should_export_csv(self):
return self.should_export_csv
def get_should_export_explanation_csv(self):
return self.should_export_explanation_csv

def get_explanation_table(self):
return self.explanation_table
Expand Down
5 changes: 1 addition & 4 deletions src/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def process_directory_files(
logger.info(
f"(/{files_counter}) Graded with score: {round(score, 2)}\t {default_answers_summary} \t file: '{file_id}'"
)
if evaluation_config_for_response.get_should_export_csv():
if evaluation_config_for_response.get_should_export_explanation_csv():
explanation_table = evaluation_config_for_response.get_explanation_table()
explanation_table = table_to_df(explanation_table)
explanation_table.to_csv(
Expand All @@ -339,9 +339,6 @@ def process_directory_files(
else:
logger.info(f"(/{files_counter}) Processed file: '{file_id}'")




# TODO: move this logic inside the class
save_marked_dir = template.get_save_marked_dir()

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/evaluation_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"description": "Whether to print the table explaining question-wise verdicts",
"type": "boolean",
},
"should_export_csv": {
"should_export_explanation_csv": {
"description": "Whether to export the explanation of evaluation results as a CSV file",
"type": "boolean",
},
Expand Down

0 comments on commit 2d20206

Please sign in to comment.