Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ with col1:
|
|
10 |
st.title("Spamd: Turkish Spam Detector")
|
11 |
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.")
|
12 |
with col2:
|
13 |
-
|
14 |
-
|
15 |
if st.button('Load Model', disabled=False):
|
16 |
with st.spinner('Wait for it...'):
|
17 |
import torch
|
@@ -59,11 +59,10 @@ if st.button('Load Model', disabled=False):
|
|
59 |
pred = 'Predicted Class: '+ prediction
|
60 |
return pred
|
61 |
placeholder.text_input("Enter the text you'd like to analyze for spam.", disabled=False, key="2")
|
62 |
-
placeholder2.button('Analyze', disabled=False, key="2")
|
63 |
-
if
|
64 |
with col2:
|
65 |
-
|
66 |
-
st.header(predict(text))
|
67 |
|
68 |
|
69 |
|
|
|
10 |
st.title("Spamd: Turkish Spam Detector")
|
11 |
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.")
|
12 |
with col2:
|
13 |
+
text = placeholder.text_input("Enter the text you'd like to analyze for spam.", disabled=True, key="1")
|
14 |
+
aButton = placeholder2.button('Analyze', disabled=True, key="1")
|
15 |
if st.button('Load Model', disabled=False):
|
16 |
with st.spinner('Wait for it...'):
|
17 |
import torch
|
|
|
59 |
pred = 'Predicted Class: '+ prediction
|
60 |
return pred
|
61 |
placeholder.text_input("Enter the text you'd like to analyze for spam.", disabled=False, key="2")
|
62 |
+
placeholder2.button('Analyze', disabled=False, key="2")
|
63 |
+
if text or aButton:
|
64 |
with col2:
|
65 |
+
st.header(predict(text))
|
|
|
66 |
|
67 |
|
68 |
|