Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,18 @@ import pickle
|
|
3 |
from tensorflow.keras.models import load_model
|
4 |
|
5 |
model = load_model('tox_model.h5')
|
6 |
-
text = st.text_area('Enter some text')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
if text:
|
9 |
-
out[6] = model.predict(
|
10 |
st.json(out)
|
|
|
3 |
from tensorflow.keras.models import load_model
|
4 |
|
5 |
model = load_model('tox_model.h5')
|
6 |
+
text = st.text_area('Enter some text', 'Type here')
|
7 |
+
|
8 |
+
comment = []
|
9 |
+
comment_input = comment.append(text)
|
10 |
+
comment_input = comment_input.apply(lambda x: clean_text(x))
|
11 |
+
comment_input = tok.texts_to_sequences(comment_input)
|
12 |
+
test = pad_sequences(comment_input,
|
13 |
+
maxlen=50,
|
14 |
+
truncating='post',
|
15 |
+
padding='post'
|
16 |
+
)
|
17 |
|
18 |
if text:
|
19 |
+
out[6] = model.predict(test)
|
20 |
st.json(out)
|