Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,18 @@ def main():
|
|
| 15 |
|
| 16 |
user_input = st.text_input("")
|
| 17 |
if user_input:
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
main()
|
|
|
|
| 15 |
|
| 16 |
user_input = st.text_input("")
|
| 17 |
if user_input:
|
| 18 |
+
try:
|
| 19 |
+
# Debugging: Print the tokenized input
|
| 20 |
+
st.write("Tokenized Input:", tokenizer(user_input))
|
| 21 |
+
|
| 22 |
+
result = sentiment_pipeline(user_input)
|
| 23 |
+
sentiment = result["label"]
|
| 24 |
+
confidence = result["score"]
|
| 25 |
|
| 26 |
+
st.write(f"Sentiment: {sentiment}")
|
| 27 |
+
st.write(f"Confidence: {confidence:.2f}")
|
| 28 |
+
except Exception as e:
|
| 29 |
+
st.write(f"Error: {e}")
|
| 30 |
|
| 31 |
if __name__ == "__main__":
|
| 32 |
main()
|