Update app.py
Browse files
app.py
CHANGED
@@ -20,15 +20,6 @@ def load_vectorizer():
|
|
20 |
return new_v
|
21 |
|
22 |
|
23 |
-
@st.cache_resource
|
24 |
-
def load_vocab():
|
25 |
-
vocab = {}
|
26 |
-
with open('vocab.txt', 'r') as f:
|
27 |
-
for line in f:
|
28 |
-
token, index = line.strip().split('\t')
|
29 |
-
vocab[token] = int(index)
|
30 |
-
|
31 |
-
|
32 |
st.title("Toxic Comment Test")
|
33 |
st.divider()
|
34 |
model = load_model()
|
@@ -41,6 +32,3 @@ if st.button("Test"):
|
|
41 |
res = (output > 0.5)
|
42 |
st.write(["toxic","severe toxic","obscene","threat","insult","identity hate"], res)
|
43 |
st.write(output)
|
44 |
-
print(output)
|
45 |
-
|
46 |
-
|
|
|
20 |
return new_v
|
21 |
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
st.title("Toxic Comment Test")
|
24 |
st.divider()
|
25 |
model = load_model()
|
|
|
32 |
res = (output > 0.5)
|
33 |
st.write(["toxic","severe toxic","obscene","threat","insult","identity hate"], res)
|
34 |
st.write(output)
|
|
|
|
|
|