Update app.py
Browse files
app.py
CHANGED
|
@@ -7,8 +7,11 @@ def main():
|
|
| 7 |
st.write("Enter a sentence to analyze its sentiment:")
|
| 8 |
user_input = st.text_input("")
|
| 9 |
if user_input:
|
| 10 |
-
result = sentiment_pipeline(user_input)
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
if __name__ == "__main__":
|
|
|
|
| 7 |
st.write("Enter a sentence to analyze its sentiment:")
|
| 8 |
user_input = st.text_input("")
|
| 9 |
if user_input:
|
| 10 |
+
result = sentiment_pipeline(user_input)
|
| 11 |
+
sentiment = result[0]["label"]
|
| 12 |
+
confidence = result[0]["score"]
|
| 13 |
+
st.write(f"Sentiment: {sentiment}")
|
| 14 |
+
st.write(f"Confidence: {confidence:.2f}")
|
| 15 |
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|