Upload streamlit_app.py
Browse files- src/streamlit_app.py +1 -27
src/streamlit_app.py
CHANGED
|
@@ -6,32 +6,6 @@ import seaborn as sns
|
|
| 6 |
from sklearn.metrics import classification_report, confusion_matrix, roc_curve, auc, precision_recall_curve, precision_score, recall_score, f1_score
|
| 7 |
import json
|
| 8 |
|
| 9 |
-
try:
|
| 10 |
-
st.sidebar.write("🔄 Пытаюсь загрузить Классическую ML для бинарной классификации...")
|
| 11 |
-
|
| 12 |
-
# Проверяем импорт
|
| 13 |
-
from use_ml import predict_sentiment
|
| 14 |
-
|
| 15 |
-
st.sidebar.success("✅ Модуль use_ml импортирован")
|
| 16 |
-
|
| 17 |
-
# Пробуем вызвать функцию
|
| 18 |
-
model_func = predict_sentiment()
|
| 19 |
-
st.sidebar.success("✅ Функция predict_sentiment() вызвана успешно")
|
| 20 |
-
|
| 21 |
-
# Проверяем, что возвращается callable объект
|
| 22 |
-
if callable(model_func):
|
| 23 |
-
st.sidebar.success("✅ Функция возвращает callable объект")
|
| 24 |
-
else:
|
| 25 |
-
st.sidebar.error(f"❌ Функция вернула не callable: {type(model_func)}")
|
| 26 |
-
|
| 27 |
-
except ImportError as e:
|
| 28 |
-
st.sidebar.error(f"❌ Ошибка импорта: {e}")
|
| 29 |
-
except Exception as e:
|
| 30 |
-
st.sidebar.error(f"❌ Общая ошибка: {e}")
|
| 31 |
-
import traceback
|
| 32 |
-
|
| 33 |
-
st.sidebar.code(traceback.format_exc())
|
| 34 |
-
|
| 35 |
# Импортируем ваши модули
|
| 36 |
try:
|
| 37 |
from use_ml import predict_sentiment, predict_category, predict_categorys
|
|
@@ -66,7 +40,7 @@ def load_models(task_type):
|
|
| 66 |
try:
|
| 67 |
models["Классическая ML"] = predict_sentiment()
|
| 68 |
except:
|
| 69 |
-
|
| 70 |
try:
|
| 71 |
models["Нейросеть"] = nn_predict_sentiment()
|
| 72 |
except:
|
|
|
|
| 6 |
from sklearn.metrics import classification_report, confusion_matrix, roc_curve, auc, precision_recall_curve, precision_score, recall_score, f1_score
|
| 7 |
import json
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Импортируем ваши модули
|
| 10 |
try:
|
| 11 |
from use_ml import predict_sentiment, predict_category, predict_categorys
|
|
|
|
| 40 |
try:
|
| 41 |
models["Классическая ML"] = predict_sentiment()
|
| 42 |
except:
|
| 43 |
+
pass
|
| 44 |
try:
|
| 45 |
models["Нейросеть"] = nn_predict_sentiment()
|
| 46 |
except:
|