khhuiyh commited on
Commit
c205b58
·
1 Parent(s): 3e67624

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -82,7 +82,6 @@ def prediction_analyse(prediction_content,questiontype_list):
82
  print(f"Warning: Skipping invalid JSON data in line: {prediction}")
83
  continue
84
  question_id = str(prediction["ID"])
85
- print(question_id)
86
  item_gt = id2item[question_id]
87
  rule = item_gt['Rule']
88
  question_type = item_gt["Dimension"]
@@ -97,7 +96,7 @@ def prediction_analyse(prediction_content,questiontype_list):
97
  results[question_type]["correct"] += 1
98
 
99
  results[question_type]["total"] += 1
100
-
101
  return results
102
 
103
 
@@ -140,14 +139,14 @@ def add_new_eval(
140
 
141
  prediction = prediction_analyse(content,questiontype)
142
 
143
- each_task_accuracy = {i: round(prediction[i]["correct"] / prediction[i]["total"] * 100, 1) for i in questiontype}
144
 
145
  total_correct_video = sum(prediction[i]["correct"] for i in questiontype)
146
 
147
  total_video = sum(prediction[i]["total"] for i in questiontype)
148
 
149
 
150
- average_accuracy_video = round(total_correct_video / total_video * 100, 1)
151
 
152
 
153
  col = csv_data.shape[0]
 
82
  print(f"Warning: Skipping invalid JSON data in line: {prediction}")
83
  continue
84
  question_id = str(prediction["ID"])
 
85
  item_gt = id2item[question_id]
86
  rule = item_gt['Rule']
87
  question_type = item_gt["Dimension"]
 
96
  results[question_type]["correct"] += 1
97
 
98
  results[question_type]["total"] += 1
99
+ break
100
  return results
101
 
102
 
 
139
 
140
  prediction = prediction_analyse(content,questiontype)
141
 
142
+ each_task_accuracy = {i: round(prediction[i]["correct"] / max(1, prediction[i]["total"]) * 100, 1) for i in questiontype}
143
 
144
  total_correct_video = sum(prediction[i]["correct"] for i in questiontype)
145
 
146
  total_video = sum(prediction[i]["total"] for i in questiontype)
147
 
148
 
149
+ average_accuracy_video = round(total_correct_video / max(1, total_video) * 100, 1)
150
 
151
 
152
  col = csv_data.shape[0]