MINHCT commited on
Commit
901b98e
β€’
1 Parent(s): 0ca0107

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -108,7 +108,7 @@ def process_api(text):
108
 
109
  return {
110
  'predicted_label_logistic': decodedLabel(int(Logistic_Predicted[0])),
111
- #'probability_logistic': int(float(np.max(Logistic_Predicted_proba))*10000//100),
112
  'SVM_Predicted': decodedLabel(int(SVM_Predicted[0])),
113
  # 'LSTM': decodedLabel(int(predicted_label_index)),
114
  'Article_Content': text
@@ -217,10 +217,10 @@ if url:
217
  st.divider() # πŸ‘ˆ Draws a horizontal rule
218
  st.title('Predicted Results')
219
  st.json({
220
- # "Logistic": {
221
- # "predicted_label_logistic": result.get("predicted_label_logistic"),
222
- # "probability_logistic": result.get("probability_logistic")
223
- # },
224
  "Logistic": result.get("predicted_label_logistic"),
225
  "SVC": result.get("SVM_Predicted"),
226
  # "LSTM": result.get("LSTM")
 
108
 
109
  return {
110
  'predicted_label_logistic': decodedLabel(int(Logistic_Predicted[0])),
111
+ 'probability_logistic': f"{int(float(np.max(Logistic_Predicted_proba))*10000//100)}%",
112
  'SVM_Predicted': decodedLabel(int(SVM_Predicted[0])),
113
  # 'LSTM': decodedLabel(int(predicted_label_index)),
114
  'Article_Content': text
 
217
  st.divider() # πŸ‘ˆ Draws a horizontal rule
218
  st.title('Predicted Results')
219
  st.json({
220
+ "Logistic": {
221
+ "predicted_label": result.get("predicted_label_logistic"),
222
+ "probability": result.get("probability_logistic")
223
+ },
224
  "Logistic": result.get("predicted_label_logistic"),
225
  "SVC": result.get("SVM_Predicted"),
226
  # "LSTM": result.get("LSTM")