Spaces:
Runtime error
Runtime error
Commit
·
673a35d
1
Parent(s):
7e0f5c4
Update app.py
Browse files
app.py
CHANGED
@@ -42,10 +42,10 @@ with site_header:
|
|
42 |
|
43 |
|
44 |
with tweet_input:
|
45 |
-
st.header('Is Your
|
46 |
st.write("""*Please note that this prediction is based on how the model was trained, so it may not be an accurate representation.*""")
|
47 |
# user input here
|
48 |
-
user_text = st.text_input('Enter
|
49 |
|
50 |
with model_results:
|
51 |
st.subheader('Prediction:')
|
@@ -72,13 +72,13 @@ with model_results:
|
|
72 |
X_test_count = tfidf.transform(X_test)
|
73 |
|
74 |
# loading in model
|
75 |
-
final_model = joblib.load(open('
|
76 |
|
77 |
# apply model to make predictions
|
78 |
prediction = final_model.predict(X_test_count[0])
|
79 |
|
80 |
if prediction == 0:
|
81 |
-
st.subheader('**Not
|
82 |
else:
|
83 |
-
st.subheader('**
|
84 |
st.text('')
|
|
|
42 |
|
43 |
|
44 |
with tweet_input:
|
45 |
+
st.header('Is Your Text Considered Toxic?')
|
46 |
st.write("""*Please note that this prediction is based on how the model was trained, so it may not be an accurate representation.*""")
|
47 |
# user input here
|
48 |
+
user_text = st.text_input('Enter Text', max_chars=280) # setting input as user_text
|
49 |
|
50 |
with model_results:
|
51 |
st.subheader('Prediction:')
|
|
|
72 |
X_test_count = tfidf.transform(X_test)
|
73 |
|
74 |
# loading in model
|
75 |
+
final_model = joblib.load(open('final_bayes.pickle', 'rb'))
|
76 |
|
77 |
# apply model to make predictions
|
78 |
prediction = final_model.predict(X_test_count[0])
|
79 |
|
80 |
if prediction == 0:
|
81 |
+
st.subheader('**Not Toxic**')
|
82 |
else:
|
83 |
+
st.subheader('**Toxic**')
|
84 |
st.text('')
|