JustHuggingFaces commited on
Commit
3663d08
1 Parent(s): d64d5d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -6,6 +6,10 @@ from txtai.pipeline import TextToSpeech
6
  # Load the text classification model pipeline, filter out the spam and leave the ham
7
  classifier = pipeline("text-classification", model='JustHuggingFaces/OptimalSpamDetect')
8
  to_speech = TextToSpeech("NeuML/ljspeech-jets-onnx")
 
 
 
 
9
  # Streamlit application title
10
  st.title("Reading Ham")
11
  st.write("Classification for Spam Email: Spam or Ham?")
@@ -22,6 +26,7 @@ if st.button("Classify"):
22
  #st.write("Text:", text)
23
  st.write("Spam!")
24
  #st.write("Label: ", result['label'])
 
25
  else:
26
  st.write("Ham!")
27
  #st.write("Label: ", result['label'])
 
6
  # Load the text classification model pipeline, filter out the spam and leave the ham
7
  classifier = pipeline("text-classification", model='JustHuggingFaces/OptimalSpamDetect')
8
  to_speech = TextToSpeech("NeuML/ljspeech-jets-onnx")
9
+ # Set the images for better user experience
10
+ ham_pic =
11
+ spam_pic = "https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/data/spam-ham/1-introduction.html?topic=berkeley_bjc%2Fareas%2Fdata.topic"
12
+
13
  # Streamlit application title
14
  st.title("Reading Ham")
15
  st.write("Classification for Spam Email: Spam or Ham?")
 
26
  #st.write("Text:", text)
27
  st.write("Spam!")
28
  #st.write("Label: ", result['label'])
29
+ st.image(spam_pic, caption="It's a spam!")
30
  else:
31
  st.write("Ham!")
32
  #st.write("Label: ", result['label'])