prashant
commited on
Commit
•
d3cc512
1
Parent(s):
596accd
decorator check
Browse files- appStore/sdg_analysis.py +34 -29
appStore/sdg_analysis.py
CHANGED
@@ -16,6 +16,7 @@ from docx.shared import Pt
|
|
16 |
from docx.enum.style import WD_STYLE_TYPE
|
17 |
from utils.sdg_classifier import sdg_classification
|
18 |
from utils.sdg_classifier import runSDGPreprocessingPipeline
|
|
|
19 |
import tempfile
|
20 |
import sqlite3
|
21 |
import logging
|
@@ -42,37 +43,41 @@ def app():
|
|
42 |
st.markdown("")
|
43 |
|
44 |
|
45 |
-
with st.container():
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
if 'filepath' in st.session_state:
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
|
77 |
|
78 |
# 1. Keyword heatmap \n
|
|
|
16 |
from docx.enum.style import WD_STYLE_TYPE
|
17 |
from utils.sdg_classifier import sdg_classification
|
18 |
from utils.sdg_classifier import runSDGPreprocessingPipeline
|
19 |
+
from utils.streamlitcheck import check_streamlit
|
20 |
import tempfile
|
21 |
import sqlite3
|
22 |
import logging
|
|
|
43 |
st.markdown("")
|
44 |
|
45 |
|
46 |
+
with st.container():
|
47 |
+
if check_streamlit():
|
48 |
+
st.write(True)
|
49 |
+
else:
|
50 |
+
st.write(False)
|
51 |
|
52 |
+
# if 'filepath' in st.session_state:
|
53 |
+
# paraList = runSDGPreprocessingPipeline()
|
54 |
+
# if len(paraList) > 150:
|
55 |
+
# warning_msg = ": This might take sometime, please sit back and relax."
|
56 |
+
# else:
|
57 |
+
# warning_msg = ""
|
58 |
+
|
59 |
+
# with st.spinner("Running SDG Classification{}".format(warning_msg)):
|
60 |
+
|
61 |
+
# df, x = sdg_classification(paraList)
|
62 |
+
|
63 |
+
# plt.rcParams['font.size'] = 25
|
64 |
+
# colors = plt.get_cmap('Blues')(np.linspace(0.2, 0.7, len(x)))
|
65 |
+
# # plot
|
66 |
+
# fig, ax = plt.subplots()
|
67 |
+
# ax.pie(x, colors=colors, radius=2, center=(4, 4),
|
68 |
+
# wedgeprops={"linewidth": 1, "edgecolor": "white"},
|
69 |
+
# frame=False,labels =list(x.index))
|
70 |
+
# # fig.savefig('temp.png', bbox_inches='tight',dpi= 100)
|
71 |
+
# st.markdown("#### Anything related to SDGs? ####")
|
72 |
+
|
73 |
+
# c4, c5, c6 = st.columns([2, 2, 2])
|
74 |
+
|
75 |
+
# with c5:
|
76 |
+
# st.pyplot(fig)
|
77 |
|
78 |
+
# c7, c8, c9 = st.columns([1, 10, 1])
|
79 |
+
# with c8:
|
80 |
+
# st.table(df)
|
81 |
|
82 |
|
83 |
# 1. Keyword heatmap \n
|