Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -105,14 +105,8 @@ def process_api(text):
|
|
105 |
print('SVM', int(SVM_Predicted[0]), svc_debug)
|
106 |
|
107 |
return {
|
108 |
-
'Logistic_Predicted':
|
109 |
-
|
110 |
-
'probability': int(float(np.max(Logistic_Predicted_proba))*10000//100)
|
111 |
-
},
|
112 |
-
'SVM_Predicted': {
|
113 |
-
'predicted_label': decodedLabel(int(SVM_Predicted[0])),
|
114 |
-
'probability': int(float(np.max(svm_probs))*10000//100)
|
115 |
-
},
|
116 |
# 'LSTM': decodedLabel(int(predicted_label_index)),
|
117 |
'Article_Content': text
|
118 |
}
|
@@ -122,7 +116,7 @@ def categorize(url):
|
|
122 |
try:
|
123 |
article_content = crawURL(url)
|
124 |
result = process_api(article_content)
|
125 |
-
return
|
126 |
except Exception as error:
|
127 |
if hasattr(error, 'message'):
|
128 |
return {"error_message": error.message}
|
|
|
105 |
print('SVM', int(SVM_Predicted[0]), svc_debug)
|
106 |
|
107 |
return {
|
108 |
+
'Logistic_Predicted': decodedLabel(int(Logistic_Predicted[0])),
|
109 |
+
'SVM_Predicted': decodedLabel(int(SVM_Predicted[0])),
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
# 'LSTM': decodedLabel(int(predicted_label_index)),
|
111 |
'Article_Content': text
|
112 |
}
|
|
|
116 |
try:
|
117 |
article_content = crawURL(url)
|
118 |
result = process_api(article_content)
|
119 |
+
return result
|
120 |
except Exception as error:
|
121 |
if hasattr(error, 'message'):
|
122 |
return {"error_message": error.message}
|