NimaKL commited on
Commit
24065d4
Β·
1 Parent(s): d8a6944

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -10,7 +10,7 @@ with col1:
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
  with col2:
13
- st.title("Spamd: Turkish Spam Detector")
14
  if st.button('Load Model'):
15
  with st.spinner('Wait for it...'):
16
 
@@ -66,13 +66,11 @@ with col2:
66
 
67
  prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
68
  pred = 'Predicted Class: '+ prediction
69
- with col2:
70
- st.header(pred)
71
 
72
- #st.write('Input', namestr(new_sentence, globals()),': \n', new_sentence)
73
- with col2:
74
- text = st.text_input("Enter the text you'd like to analyze for spam.")
75
- if text or st.button('Analyze'):
76
- predict(text)
77
  st.success("Model Loaded!")
78
-
 
 
 
 
 
 
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
  with col2:
13
+ st.title("Model:")
14
  if st.button('Load Model'):
15
  with st.spinner('Wait for it...'):
16
 
 
66
 
67
  prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
68
  pred = 'Predicted Class: '+ prediction
 
 
69
 
 
 
 
 
 
70
  st.success("Model Loaded!")
71
+
72
+ with col2:
73
+ st.header(pred)
74
+ text = st.text_input("Enter the text you'd like to analyze for spam.")
75
+ if text or st.button('Analyze'):
76
+ predict(text)