Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
-
|
| 4 |
classifier = pipeline("text-classification", model='isom5240sp24/bert-base-uncased-emotion', return_all_scores=True)
|
| 5 |
-
|
| 6 |
st.title("Text Classification for you")
|
| 7 |
st.write("Classification for 6 emotions: sadness, joy, love, anger, fear, surprise")
|
| 8 |
-
|
| 9 |
text = st.text_area("Enter the text to classify", "")
|
| 10 |
-
|
|
|
|
| 11 |
if st.button("Classify"):
|
| 12 |
results = classifier(text)[0]
|
| 13 |
-
|
| 14 |
-
# Display the classification result
|
| 15 |
max_score = float('-inf')
|
| 16 |
max_label = ''
|
| 17 |
for result in results:
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
+
|
| 4 |
classifier = pipeline("text-classification", model='isom5240sp24/bert-base-uncased-emotion', return_all_scores=True)
|
| 5 |
+
|
| 6 |
st.title("Text Classification for you")
|
| 7 |
st.write("Classification for 6 emotions: sadness, joy, love, anger, fear, surprise")
|
| 8 |
+
|
| 9 |
text = st.text_area("Enter the text to classify", "")
|
| 10 |
+
|
| 11 |
+
|
| 12 |
if st.button("Classify"):
|
| 13 |
results = classifier(text)[0]
|
| 14 |
+
|
|
|
|
| 15 |
max_score = float('-inf')
|
| 16 |
max_label = ''
|
| 17 |
for result in results:
|