Spaces:
Running
Running
huangshiyu
commited on
Commit
·
c571a53
1
Parent(s):
57707d6
update
Browse files- compute_accuracy.py +2 -3
compute_accuracy.py
CHANGED
|
@@ -3,7 +3,7 @@ import jsonlines
|
|
| 3 |
from collections import defaultdict
|
| 4 |
|
| 5 |
|
| 6 |
-
def compute_accuracy(
|
| 7 |
total_qa_num = 0
|
| 8 |
total_answered_num = 0
|
| 9 |
right_num = 0
|
|
@@ -12,8 +12,7 @@ def compute_accuracy(answer_file: str, video_meta_file: str):
|
|
| 12 |
category_total = defaultdict(float)
|
| 13 |
category_acc = defaultdict(float)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
model_answers = json.load(f)
|
| 17 |
|
| 18 |
with jsonlines.open(video_meta_file) as reader:
|
| 19 |
video_meta = list(reader)
|
|
|
|
| 3 |
from collections import defaultdict
|
| 4 |
|
| 5 |
|
| 6 |
+
def compute_accuracy(model_answers: dict, video_meta_file: str):
|
| 7 |
total_qa_num = 0
|
| 8 |
total_answered_num = 0
|
| 9 |
right_num = 0
|
|
|
|
| 12 |
category_total = defaultdict(float)
|
| 13 |
category_acc = defaultdict(float)
|
| 14 |
|
| 15 |
+
|
|
|
|
| 16 |
|
| 17 |
with jsonlines.open(video_meta_file) as reader:
|
| 18 |
video_meta = list(reader)
|