Cast to float
This commit is contained in:
parent
5742eaf275
commit
e39c77807c
|
@ -43,10 +43,10 @@ async def run_test():
|
|||
if "text" in j and "result" in j:
|
||||
n = 0
|
||||
for word in j["result"]:
|
||||
n += int(word["conf"])
|
||||
if int(word["conf"]) > 0.7:
|
||||
n += float(word["conf"])
|
||||
if float(word["conf"]) > 0.7:
|
||||
print(colored(word["word"], "green"), end=" ")
|
||||
elif int(word["conf"]) > 0.7:
|
||||
elif float(word["conf"]) > 0.5:
|
||||
print(colored(word["word"], "yellow"), end=" ")
|
||||
else:
|
||||
print(colored(word["word"], "red"), end=" ")
|
||||
|
|
Loading…
Reference in New Issue