File size: 507 Bytes
5139c5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def check_score(probability: float):
    return_value = {
        "probability": probability,
        "score": 0,
    }
    if 0.95 <= probability <= 1:
        return_value["score"] = 4
        return return_value
    elif 0.89 <= probability <= 0.95:
        return_value["score"] = 3
        return return_value
    elif 0.75 <= probability <= 0.89:
        return_value["score"] = 2
        return return_value
    elif probability <= 0.75:
        return_value["score"] = 1
        return return_value