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:
|
if "text" in j and "result" in j:
|
||||||
n = 0
|
n = 0
|
||||||
for word in j["result"]:
|
for word in j["result"]:
|
||||||
n += int(word["conf"])
|
n += float(word["conf"])
|
||||||
if int(word["conf"]) > 0.7:
|
if float(word["conf"]) > 0.7:
|
||||||
print(colored(word["word"], "green"), end=" ")
|
print(colored(word["word"], "green"), end=" ")
|
||||||
elif int(word["conf"]) > 0.7:
|
elif float(word["conf"]) > 0.5:
|
||||||
print(colored(word["word"], "yellow"), end=" ")
|
print(colored(word["word"], "yellow"), end=" ")
|
||||||
else:
|
else:
|
||||||
print(colored(word["word"], "red"), end=" ")
|
print(colored(word["word"], "red"), end=" ")
|
||||||
|
|
Loading…
Reference in New Issue