JustHuggingFaces commited on
Commit
0500fd7
1 Parent(s): c081ece

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -14,15 +14,14 @@ text = st.text_area("Paste the email to classify", "")
14
  # Perform text classification when the user clicks the "Classify" button
15
  if st.button("Classify"):
16
  # Perform text classification on the input text
17
- results = classifier(text)[0]
18
  # Display the classification result
19
  spam = "LABEL_1"
20
  ham = "LABEL_0"
21
- for result in results:
22
- if result['label'] == spam:
23
- #st.write("Text:", text)
24
- st.write("Spam!")
25
- else:
26
- st.write("Ham!")
27
- speech = to_speech(text)
28
- st.audio(speech, sample_rate=16000)
 
14
  # Perform text classification when the user clicks the "Classify" button
15
  if st.button("Classify"):
16
  # Perform text classification on the input text
17
+ result = classifier(text)[0]
18
  # Display the classification result
19
  spam = "LABEL_1"
20
  ham = "LABEL_0"
21
+ if result['label'] == spam:
22
+ #st.write("Text:", text)
23
+ st.write("Spam!")
24
+ else:
25
+ st.write("Ham!")
26
+ speech = to_speech(text)
27
+ st.audio(speech, sample_rate=16000)