NimaKL commited on
Commit
e3c3d2e
·
1 Parent(s): 30da515

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -36,7 +36,7 @@ with col1:
36
  st.title("TC32 Multi-Class Text Classification")
37
  st.subheader('Model Loss and Accuracy')
38
  st.markdown("<br>", unsafe_allow_html=True)
39
- st.area_chart(chart_data, height=325)
40
  yorum_model, tokenizer = load_model()
41
 
42
 
@@ -45,7 +45,6 @@ with col2:
45
  st.subheader("Enter complaint (in Turkish) to find the class.")
46
  #st.subheader("Şikayet")
47
  text = st.text_area("", "Bebeğim haftada bir kutu mama bitiriyor. Geçen hafta 135 tl'ye aldığım mama bugün 180 tl olmuş. Ben de artık aptamil almayacağım. Tüketici haklarına şikayet etmemiz gerekiyor. Yazıklar olsun.", height=240)
48
- aButton = st.button('Ara')
49
 
50
  def prepare_data(input_text, tokenizer):
51
  token = tokenizer.encode_plus(
@@ -66,7 +65,7 @@ def make_prediction(model, processed_data, classes=['Alışveriş','Anne-Bebek',
66
  return classes[np.argmax(probs)]
67
 
68
 
69
- if text or aButton:
70
  with col1:
71
  with st.spinner('Wait for it...'):
72
  processed_data = prepare_data(text, tokenizer)
 
36
  st.title("TC32 Multi-Class Text Classification")
37
  st.subheader('Model Loss and Accuracy')
38
  st.markdown("<br>", unsafe_allow_html=True)
39
+ st.area_chart(chart_data, height=320)
40
  yorum_model, tokenizer = load_model()
41
 
42
 
 
45
  st.subheader("Enter complaint (in Turkish) to find the class.")
46
  #st.subheader("Şikayet")
47
  text = st.text_area("", "Bebeğim haftada bir kutu mama bitiriyor. Geçen hafta 135 tl'ye aldığım mama bugün 180 tl olmuş. Ben de artık aptamil almayacağım. Tüketici haklarına şikayet etmemiz gerekiyor. Yazıklar olsun.", height=240)
 
48
 
49
  def prepare_data(input_text, tokenizer):
50
  token = tokenizer.encode_plus(
 
65
  return classes[np.argmax(probs)]
66
 
67
 
68
+ if text:
69
  with col1:
70
  with st.spinner('Wait for it...'):
71
  processed_data = prepare_data(text, tokenizer)