pierreguillou
commited on
Commit
·
4befb45
1
Parent(s):
32fb013
Update files/functions.py
Browse files- files/functions.py +1 -0
files/functions.py
CHANGED
@@ -755,6 +755,7 @@ def predictions_line_level(max_length, tokenizer, id2label, dataset, outputs, im
|
|
755 |
probs_label = list()
|
756 |
for probs_list in probs:
|
757 |
prob_label = reduce(lambda x, y: x*y, probs_list)
|
|
|
758 |
probs_label.append(prob_label)
|
759 |
max_value = max(probs_label)
|
760 |
max_index = probs_label.index(max_value)
|
|
|
755 |
probs_label = list()
|
756 |
for probs_list in probs:
|
757 |
prob_label = reduce(lambda x, y: x*y, probs_list)
|
758 |
+
prob_label = prob_label**(1./(len(probs_list))) # normalization
|
759 |
probs_label.append(prob_label)
|
760 |
max_value = max(probs_label)
|
761 |
max_index = probs_label.index(max_value)
|