Spaces:
Sleeping
Sleeping
ngocminhta commited on
Commit ·
7936c71
1
Parent(s): 5b2f797
update batch process
Browse files
infer.py
CHANGED
|
@@ -90,12 +90,12 @@ def infer_3_class(model, tokenizer, index, label_dict, is_mixed_dict, text_list,
|
|
| 90 |
fuzzy_cnt[label] += weight * boost
|
| 91 |
|
| 92 |
total_score = sum(fuzzy_cnt.values())
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
return pred
|
| 100 |
|
| 101 |
|
|
|
|
| 90 |
fuzzy_cnt[label] += weight * boost
|
| 91 |
|
| 92 |
total_score = sum(fuzzy_cnt.values())
|
| 93 |
+
final = dict()
|
| 94 |
+
final[0] = round(fuzzy_cnt[(1,0)] / total_score*100,2)
|
| 95 |
+
final[1] = round(fuzzy_cnt[(0,10^3)] / total_score*100,2)
|
| 96 |
+
final[2] = round(fuzzy_cnt[(1,1)] / total_score*100,2)
|
| 97 |
+
print(f"Final prediction: {final}")
|
| 98 |
+
pred.append(final)
|
| 99 |
return pred
|
| 100 |
|
| 101 |
|