Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
18 |
# Display the classification result
|
19 |
spam = "LABEL_1"
|
20 |
ham = "LABEL_0"
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
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)
|
|