Spaces:
Sleeping
Sleeping
Vladislawoo
commited on
Commit
·
19ef4fe
1
Parent(s):
8380741
Update app.py
Browse files
app.py
CHANGED
@@ -50,16 +50,7 @@ def predict_text(text):
|
|
50 |
return predicted_class
|
51 |
|
52 |
|
53 |
-
def main():
|
54 |
-
page_selection = st.sidebar.selectbox("Выберите страницу:", ["Классификация отзывов", "Анализ токсичности"])
|
55 |
-
|
56 |
-
if page_selection == "Классификация отзывов":
|
57 |
-
page_reviews_classification()
|
58 |
-
elif page_selection == "Анализ токсичности":
|
59 |
-
page_toxicity_analysis()
|
60 |
|
61 |
-
if __name__ == "__main__":
|
62 |
-
main()
|
63 |
|
64 |
|
65 |
def page_reviews_classification():
|
@@ -121,4 +112,16 @@ def page_toxicity_analysis():
|
|
121 |
elapsed_time = time.time() - start_time
|
122 |
|
123 |
for label, prob in probs.items():
|
124 |
-
st.write(f"Вероятность {label}: {prob:.4f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
return predicted_class
|
51 |
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
|
|
|
|
54 |
|
55 |
|
56 |
def page_reviews_classification():
|
|
|
112 |
elapsed_time = time.time() - start_time
|
113 |
|
114 |
for label, prob in probs.items():
|
115 |
+
st.write(f"Вероятность {label}: {prob:.4f}")
|
116 |
+
|
117 |
+
|
118 |
+
def main():
|
119 |
+
page_selection = st.sidebar.selectbox("Выберите страницу:", ["Классификация отзывов", "Анализ токсичности"])
|
120 |
+
|
121 |
+
if page_selection == "Классификация отзывов":
|
122 |
+
page_reviews_classification()
|
123 |
+
elif page_selection == "Анализ токсичности":
|
124 |
+
page_toxicity_analysis()
|
125 |
+
|
126 |
+
if __name__ == "__main__":
|
127 |
+
main()
|