Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,21 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ***** Finacial Sentiment Analysis App *****
|
2 |
+
# Team *** AI Supremo
|
3 |
+
# Author *** Lerato Chere
|
4 |
+
|
5 |
+
import streamlit as st
|
6 |
+
from transformers import pipeline
|
7 |
+
|
8 |
+
sentiment_pipeline = pipeline("sentiment-analysis")
|
9 |
+
|
10 |
+
st.title("Financial Sentiment Analysis \n Team AI Supremo ")
|
11 |
+
st.write("Enter a Financial Statement to Analyze the Sentiment:")
|
12 |
+
user_input = st.text_input("")
|
13 |
+
st.write("Press the Enter key")
|
14 |
+
|
15 |
+
if user_input:
|
16 |
+
result = sentiment_pipeline(user_input)
|
17 |
+
sentiment = result[0]["label"]
|
18 |
+
confidence = result[0]["score"]
|
19 |
+
|
20 |
+
st.write(f"Sentiment: {sentiment}")
|
21 |
+
st.write(f"Confidence: {confidence:.2%}")
|