Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,8 @@ def process_api(text):
|
|
105 |
print('SVM', int(SVM_Predicted[0]), svc_debug)
|
106 |
|
107 |
return {
|
108 |
-
'
|
|
|
109 |
'SVM_Predicted': decodedLabel(int(SVM_Predicted[0])),
|
110 |
# 'LSTM': decodedLabel(int(predicted_label_index)),
|
111 |
'Article_Content': text
|
@@ -214,7 +215,10 @@ if url:
|
|
214 |
st.divider() # 👈 Draws a horizontal rule
|
215 |
st.title('Predicted Results')
|
216 |
st.json({
|
217 |
-
"Logistic":
|
|
|
|
|
|
|
218 |
"SVC": result.get("SVM_Predicted"),
|
219 |
# "LSTM": result.get("LSTM")
|
220 |
})
|
|
|
105 |
print('SVM', int(SVM_Predicted[0]), svc_debug)
|
106 |
|
107 |
return {
|
108 |
+
'predicted_label_logistic': decodedLabel(int(Logistic_Predicted[0])),
|
109 |
+
'probability_logistic': int(float(np.max(Logistic_Predicted_proba))*10000//100), # Thêm phần xác suất từ mô hình Seq_Predicted vào đây
|
110 |
'SVM_Predicted': decodedLabel(int(SVM_Predicted[0])),
|
111 |
# 'LSTM': decodedLabel(int(predicted_label_index)),
|
112 |
'Article_Content': text
|
|
|
215 |
st.divider() # 👈 Draws a horizontal rule
|
216 |
st.title('Predicted Results')
|
217 |
st.json({
|
218 |
+
"Logistic": {
|
219 |
+
"predicted_label": result.get("predicted_label_logistic"),
|
220 |
+
"probability": result.get("probability_logistic")
|
221 |
+
},
|
222 |
"SVC": result.get("SVM_Predicted"),
|
223 |
# "LSTM": result.get("LSTM")
|
224 |
})
|