Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,7 @@ with col1:
|
|
9 |
st.title("Spamd: Turkish Spam Detector")
|
10 |
st.markdown("Message spam detection tool for Turkish language. Due the small size of the dataset, I decided to go with transformers technology Google BERT. Using the Turkish pre-trained model BERTurk, I imporved the accuracy of the tool by 18 percent compared to the previous model which used fastText.")
|
11 |
|
12 |
-
|
13 |
-
st.title("Model:")
|
14 |
if st.button('Load Model', disabled=False):
|
15 |
with st.spinner('Wait for it...'):
|
16 |
|
@@ -65,10 +64,11 @@ with col2:
|
|
65 |
|
66 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
67 |
pred = 'Predicted Class: '+ prediction
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
72 |
|
73 |
|
74 |
|
|
|
9 |
st.title("Spamd: Turkish Spam Detector")
|
10 |
st.markdown("Message spam detection tool for Turkish language. Due the small size of the dataset, I decided to go with transformers technology Google BERT. Using the Turkish pre-trained model BERTurk, I imporved the accuracy of the tool by 18 percent compared to the previous model which used fastText.")
|
11 |
|
12 |
+
|
|
|
13 |
if st.button('Load Model', disabled=False):
|
14 |
with st.spinner('Wait for it...'):
|
15 |
|
|
|
64 |
|
65 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
66 |
pred = 'Predicted Class: '+ prediction
|
67 |
+
with col2:
|
68 |
+
st.header(pred)
|
69 |
+
text = st.text_input("Enter the text you'd like to analyze for spam.")
|
70 |
+
if text or st.button('Analyze'):
|
71 |
+
predict(text)
|
72 |
|
73 |
|
74 |
|