Spaces:
Sleeping
Sleeping
Commit ·
e2392af
1
Parent(s): 051f891
mini change
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
print ("Load
|
| 5 |
|
| 6 |
# Load the pre-trained emotion classification pipeline
|
| 7 |
model_name = "bhadresh-savani/distilbert-base-uncased-emotion"
|
|
@@ -24,4 +24,5 @@ if st.button("Classify Emotion"):
|
|
| 24 |
results = emotion_classifier(input_text)
|
| 25 |
st.subheader("Predicted Emotions:")
|
| 26 |
for result in results:
|
|
|
|
| 27 |
st.write(f"**{result['label']}**: {result['score']:.4f}")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
print ("Load model...")
|
| 5 |
|
| 6 |
# Load the pre-trained emotion classification pipeline
|
| 7 |
model_name = "bhadresh-savani/distilbert-base-uncased-emotion"
|
|
|
|
| 24 |
results = emotion_classifier(input_text)
|
| 25 |
st.subheader("Predicted Emotions:")
|
| 26 |
for result in results:
|
| 27 |
+
st.write(f"**{result['label']}**: {result['score']:.4f}")
|
| 28 |
st.write(f"**{result['label']}**: {result['score']:.4f}")
|