-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import streamlit as st | ||
import re | ||
import pandas as pd | ||
from utils.functions import display_summary | ||
import utils.config | ||
|
||
|
||
def app(): | ||
try: | ||
summary_df = pd.read_csv(utils.config.SUMMARIZED_CSV) | ||
classification_df = pd.read_csv(utils.config.CLASSIFIED_CSV) | ||
topic_extraction_df = pd.read_csv(utils.config.TOPIC_EXTRACTED_CSV) | ||
|
||
except NameError: | ||
print("Some problem with file...") | ||
|
||
st.sidebar.title("Menu") | ||
company = st.sidebar.selectbox( | ||
"Choose Company", list(summary_df.loc[:, "Company"].unique()) | ||
) | ||
year = st.sidebar.selectbox("Choose Year", list(summary_df.loc[:, "Year"].unique())) | ||
|
||
which_summary = st.sidebar.selectbox( | ||
"See Summary For", ["All Sections", "Section-wise"] | ||
) | ||
|
||
show_topics = st.sidebar.checkbox("Show Important Words") | ||
|
||
show_score = False | ||
if show_topics: | ||
show_score = st.sidebar.checkbox("Show Frequency and Co-occurence Scores") | ||
|
||
st.markdown( | ||
"<h1 style='text-align: center;'>Financial Dashboard</h1>", | ||
unsafe_allow_html=True, | ||
) | ||
|
||
if which_summary == "All Sections": | ||
display_summary( | ||
summary_df, | ||
classification_df, | ||
topic_extraction_df, | ||
summary_df.columns[2:], | ||
company, | ||
year, | ||
show_topics, | ||
show_score, | ||
) | ||
else: | ||
options = st.multiselect( | ||
"Please select Section(s) to view:", summary_df.columns[2:], "Risk Factor" | ||
) | ||
display_summary( | ||
summary_df, | ||
classification_df, | ||
topic_extraction_df, | ||
options, | ||
company, | ||
year, | ||
show_topics, | ||
show_score, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
altair==4.2.0 | ||
attrs==22.1.0 | ||
blinker==1.5 | ||
cachetools==5.2.0 | ||
certifi==2022.9.24 | ||
charset-normalizer==2.1.1 | ||
click==8.1.3 | ||
commonmark==0.9.1 | ||
decorator==5.1.1 | ||
entrypoints==0.4 | ||
gitdb==4.0.9 | ||
GitPython==3.1.29 | ||
htbuilder==0.6.1 | ||
idna==3.4 | ||
importlib-metadata==5.0.0 | ||
Jinja2==3.1.2 | ||
jsonschema==4.17.0 | ||
MarkupSafe==2.1.1 | ||
more-itertools==9.0.0 | ||
numpy==1.23.4 | ||
packaging==21.3 | ||
pandas==1.5.1 | ||
Pillow==9.3.0 | ||
protobuf==3.20.3 | ||
pyarrow==10.0.0 | ||
pydeck==0.8.0b4 | ||
Pygments==2.13.0 | ||
Pympler==1.0.1 | ||
pyparsing==3.0.9 | ||
pyrsistent==0.19.2 | ||
python-dateutil==2.8.2 | ||
pytz==2022.6 | ||
pytz-deprecation-shim==0.1.0.post0 | ||
requests==2.28.1 | ||
rich==12.6.0 | ||
semver==2.13.0 | ||
six==1.16.0 | ||
smmap==5.0.0 | ||
st-annotated-text==3.0.0 | ||
streamlit==1.14.0 | ||
text-highlighter==0.0.7 | ||
toml==0.10.2 | ||
toolz==0.12.0 | ||
tornado==6.2 | ||
typing_extensions==4.4.0 | ||
tzdata==2022.6 | ||
tzlocal==4.2 | ||
urllib3==1.26.12 | ||
validators==0.20.0 | ||
watchdog==2.1.9 | ||
zipp==3.10.0 |