Commit
·
c06f677
1
Parent(s):
7864f6f
Update app.py
Browse files
app.py
CHANGED
@@ -8,5 +8,11 @@ pipe=pipeline(model="dancingninjas/sentiment-model")
|
|
8 |
text=st.text_area('Enter your text')
|
9 |
|
10 |
if text:
|
11 |
-
out=pipe(text)
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
text=st.text_area('Enter your text')
|
9 |
|
10 |
if text:
|
11 |
+
out = pipe(text)
|
12 |
+
|
13 |
+
# Convert the model's output (0 or 1) to descriptive labels
|
14 |
+
sentiment_label = "Positive" if out[0]['label'] == 'LABEL_1' else "Negative"
|
15 |
+
|
16 |
+
# Display the sentiment label and probability
|
17 |
+
st.write(f'Sentiment: {sentiment_label}')
|
18 |
+
st.write(f'Probability: {out[0]["score"]:.4f}')
|