akuysal commited on
Commit
6f7b5ee
·
1 Parent(s): 4b10007

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -4,6 +4,7 @@ import nltk
4
  import string
5
  # import for loading python objects (scikit-learn models)
6
  import pickle
 
7
 
8
  def custom_tokenizer_with_Turkish_stemmer(text):
9
  # my text was unicode so I had to use the unicode-specific translate function. If your documents are strings, you will need to use a different `translate` function here. `Translated` here just does search-replace. See the trans_table: any matching character in the set is replaced with `None`
@@ -35,15 +36,8 @@ def predictSMSdata(test_text):
35
  trans_table = {ord(c): None for c in string.punctuation + string.digits}
36
  stemmerTR = TurkishStemmer()
37
 
38
- # Extra test data from the training set
39
- # legitimate - l0430.txt
40
- predictSMSdata("Ahmet de gelecek mi?")
41
-
42
- # legitimate - l0429.txt
43
- predictSMSdata("Vakifbank WebSubem girisi icin tek kullanimlik sifreniz: 160038 . Sifreniz 3 dk gecerlidir. Tarih: 14.02.2011 Saat: 13:53")
44
-
45
- # spam - s0003.txt
46
- predictSMSdata("Aveadan SUPER bir Muzik Paketi! MAXI yaz, 5555e gonder, Maxi Muzikindir Paketi ile 150 yerli 50 Yabanci sarkiyi ayda sadece 5,99 TLye cebine indir!")
47
-
48
- # spam - s0359.txt
49
- predictSMSdata("1-2 NISAN TARIHLERINDE;DERMALOGICA CILT BAKIMINA DAVETLISINIZ.RANDEVU ALINIZ TEL:2312840")
 
4
  import string
5
  # import for loading python objects (scikit-learn models)
6
  import pickle
7
+ import streamlit as st
8
 
9
  def custom_tokenizer_with_Turkish_stemmer(text):
10
  # my text was unicode so I had to use the unicode-specific translate function. If your documents are strings, you will need to use a different `translate` function here. `Translated` here just does search-replace. See the trans_table: any matching character in the set is replaced with `None`
 
36
  trans_table = {ord(c): None for c in string.punctuation + string.digits}
37
  stemmerTR = TurkishStemmer()
38
 
39
+ text = st.text_area("enter some text!")
40
+ if text:
41
+ out = predictSMSdata(text)
42
+ st.json(out)
43
+