fix return
Browse files
app.py
CHANGED
|
@@ -85,61 +85,18 @@ def judge(x):
|
|
| 85 |
for i in range(6):
|
| 86 |
result.append((result_lstm[i]+result_gru[i])/2)
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
#print(final_result)
|
| 91 |
return_result += '\nMô hình LSTM\n'
|
| 92 |
return_result += f"{result_lstm}\n"
|
| 93 |
-
|
| 94 |
-
# if result_lstm[i]>=0 and result_lstm[i]<0.1:
|
| 95 |
-
# return_result += "Tính {} là không có\n".format(label[i])
|
| 96 |
-
# if result_lstm[i]>=0.1 and result_lstm[i]<0.5:
|
| 97 |
-
# return_result += "Tính {} ở mức không rõ ràng, không thể xác định chính xác\n".format(label[i])
|
| 98 |
-
# if result_lstm[i]>=0.5 and result_lstm[i]<0.8:
|
| 99 |
-
# return_result += "Tính {} ở mức rõ ràng, cần xem xét\n".format(label[i])
|
| 100 |
-
# if result_lstm[i]>=0.8:
|
| 101 |
-
# return_result += "Tính {} ở mức nghiêm trọng, yêu cầu chấn chỉnh\n".format(label[i])
|
| 102 |
-
|
| 103 |
|
| 104 |
return_result += '\nMô hình GRU\n'
|
| 105 |
return_result += f"{result_gru}\n"
|
| 106 |
-
# for i in range(6):
|
| 107 |
-
# if result_gru[i]>=0 and result_gru[i]<0.1:
|
| 108 |
-
# return_result += "Tính {} là không có\n".format(label[i])
|
| 109 |
-
# if result_gru[i]>=0.1 and result_gru[i]<0.5:
|
| 110 |
-
# return_result += "Tính {} ở mức không rõ ràng, không thể xác định chính xác\n".format(label[i])
|
| 111 |
-
# if result_gru[i]>=0.5 and result_gru[i]<0.8:
|
| 112 |
-
# return_result += "Tính {} ở mức rõ ràng, cần xem xét\n".format(label[i])
|
| 113 |
-
# if result_gru[i]>=0.8:
|
| 114 |
-
# return_result += "Tính {} ở mức nghiêm trọng, yêu cầu chấn chỉnh\n".format(label[i])
|
| 115 |
-
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
another_result += f"{final_result}\n"
|
| 120 |
-
|
| 121 |
-
for i in range(6):
|
| 122 |
-
if final_result[i]>=0 and final_result[i]<0.1:
|
| 123 |
-
another_result += "Tính {} là không có\n".format(label[i])
|
| 124 |
-
if final_result[i]>=0.1 and final_result[i]<0.5:
|
| 125 |
-
another_result += "Tính {} ở mức không rõ ràng, không thể xác định chính xác\n".format(label[i])
|
| 126 |
-
if final_result[i]>=0.5 and final_result[i]<0.8:
|
| 127 |
-
another_result += "Tính {} ở mức rõ ràng, cần xem xét\n".format(label[i])
|
| 128 |
-
if final_result[i]>=0.8:
|
| 129 |
-
another_result += "Tính {} ở mức nghiêm trọng, yêu cầu chấn chỉnh\n".format(label[i])
|
| 130 |
-
|
| 131 |
-
another_result += "\nKết luận:\n"
|
| 132 |
-
if max(final_result)>=0 and max(final_result)<0.1:
|
| 133 |
-
another_result += "Ngôn ngữ phù hợp mọi lứa tuổi.\n"
|
| 134 |
-
if max(final_result)>=0.1 and max(final_result)<0.5:
|
| 135 |
-
another_result += "Ngôn ngữ cần được kiểm tra lại.\n"
|
| 136 |
-
if max(final_result)>=0.5 and max(final_result)<0.8:
|
| 137 |
-
another_result += "Ngôn ngữ không phù hợp, cần xem xét lại.\n"
|
| 138 |
-
if max(final_result)>=0.8:
|
| 139 |
-
another_result += "Ngôn ngữ vi phạm tiêu chuẩn cộng đồng nghiêm trọng, yêu cầu chấn chỉnh.\n"
|
| 140 |
-
|
| 141 |
-
p = plot(final_result)
|
| 142 |
-
return (return_result)
|
| 143 |
|
| 144 |
|
| 145 |
# if __name__ == "__main__":
|
|
|
|
| 85 |
for i in range(6):
|
| 86 |
result.append((result_lstm[i]+result_gru[i])/2)
|
| 87 |
|
| 88 |
+
|
| 89 |
|
| 90 |
#print(final_result)
|
| 91 |
return_result += '\nMô hình LSTM\n'
|
| 92 |
return_result += f"{result_lstm}\n"
|
| 93 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
return_result += '\nMô hình GRU\n'
|
| 96 |
return_result += f"{result_gru}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
|
| 99 |
+
return (result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
# if __name__ == "__main__":
|