Spaces:
Sleeping
Sleeping
Added total_name_count
Browse files
utils.py
CHANGED
@@ -48,4 +48,12 @@ class Test:
|
|
48 |
answers = self.get_answers(idx)
|
49 |
index = answers.index(responce)
|
50 |
answer_ids.append(index)
|
51 |
-
return answer_ids
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
answers = self.get_answers(idx)
|
49 |
index = answers.index(responce)
|
50 |
answer_ids.append(index)
|
51 |
+
return answer_ids
|
52 |
+
|
53 |
+
def total_name_count(self):
|
54 |
+
name_count = {name: 0 for name in self.names}
|
55 |
+
for question in self.data:
|
56 |
+
for answer in question["responces"]:
|
57 |
+
for name in answer["name"]:
|
58 |
+
name_count[name] += 1
|
59 |
+
return name_count
|