statistics
Browse files- app.py +26 -11
- appStore/target.py +22 -14
app.py
CHANGED
|
@@ -23,20 +23,35 @@ with st.container():
|
|
| 23 |
st.markdown("<h2 style='text-align: center; color: black;'> Climate Policy Intelligence App </h2>", unsafe_allow_html=True)
|
| 24 |
st.write(' ')
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
|
| 36 |
sector.app, adapmit.app]
|
| 37 |
-
multiplier_val =
|
| 38 |
if st.button("Get the work done"):
|
| 39 |
-
prg = st.progress(0)
|
| 40 |
for i,func in enumerate(apps):
|
| 41 |
func()
|
| 42 |
prg.progress((i+1)*multiplier_val)
|
|
|
|
| 23 |
st.markdown("<h2 style='text-align: center; color: black;'> Climate Policy Intelligence App </h2>", unsafe_allow_html=True)
|
| 24 |
st.write(' ')
|
| 25 |
|
| 26 |
+
with st.expander("ℹ️ - About this app", expanded=False):
|
| 27 |
+
st.write(
|
| 28 |
+
"""
|
| 29 |
+
Climate Policy Understanding App is an open-source\
|
| 30 |
+
digital tool which aims to assist policy analysts and \
|
| 31 |
+
other users in extracting and filtering relevant \
|
| 32 |
+
information from public documents.
|
| 33 |
+
|
| 34 |
+
What Happens in background?
|
| 35 |
+
|
| 36 |
+
- Step 1: Once the document is provided to app, it undergoes *Pre-processing*.\
|
| 37 |
+
In this step the document is broken into smaller paragraphs \
|
| 38 |
+
(based on word/sentence count).
|
| 39 |
+
- Step 2: The paragraphs are fed to **Target Classifier** which detects if
|
| 40 |
+
the paragraph contains any *Target* related information or not.
|
| 41 |
+
- Step 3: The paragraphs which are detected containing some target \
|
| 42 |
+
related information are then fed to multiple classifier to enrich the
|
| 43 |
+
Information Extraction.
|
| 44 |
+
|
| 45 |
+
Classifiers
|
| 46 |
+
- Netzero:
|
| 47 |
+
|
| 48 |
+
""")
|
| 49 |
+
st.write("")
|
| 50 |
apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
|
| 51 |
sector.app, adapmit.app]
|
| 52 |
+
multiplier_val =100/len(apps)
|
| 53 |
if st.button("Get the work done"):
|
| 54 |
+
prg = st.progress(0.0)
|
| 55 |
for i,func in enumerate(apps):
|
| 56 |
func()
|
| 57 |
prg.progress((i+1)*multiplier_val)
|
appStore/target.py
CHANGED
|
@@ -87,25 +87,33 @@ def target_display():
|
|
| 87 |
hits = df[df['Target Label'] == 'TARGET']
|
| 88 |
range_val = min(5,len(hits))
|
| 89 |
if range_val !=0:
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
count_df = count_df.rename_axis('Target Label').reset_index()
|
| 93 |
-
count_df['Label_def'] = count_df['Target Label'].apply(lambda x: _lab_dict[x])
|
| 94 |
-
|
| 95 |
-
fig = px.bar(count_df, y="Label_def", x="count", orientation='h', height=200)
|
| 96 |
-
c1, c2 = st.columns([1,1])
|
| 97 |
-
with c1:
|
| 98 |
-
st.plotly_chart(fig,use_container_width= True)
|
| 99 |
-
|
| 100 |
-
count_netzeo = sum(hits['Netzero Label'] == 'NETZERO')
|
| 101 |
count_ghg = sum(hits['GHG Label'] == 'LABEL_2')
|
| 102 |
count_economy = sum([True if 'Economy-wide' in x else False
|
| 103 |
for x in hits['Sector Label']])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
with c2:
|
| 106 |
-
st.write('**
|
| 107 |
-
st.write('**
|
| 108 |
-
|
| 109 |
hits = hits.sort_values(by=['Relevancy'], ascending=False)
|
| 110 |
st.write("")
|
| 111 |
st.markdown("###### Top few Target Classified paragraph/text results ######")
|
|
|
|
| 87 |
hits = df[df['Target Label'] == 'TARGET']
|
| 88 |
range_val = min(5,len(hits))
|
| 89 |
if range_val !=0:
|
| 90 |
+
count_target = sum(hits['Target Label'] == 'TARGET')
|
| 91 |
+
count_netzero = sum(hits['Netzero Label'] == 'NETZERO')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
count_ghg = sum(hits['GHG Label'] == 'LABEL_2')
|
| 93 |
count_economy = sum([True if 'Economy-wide' in x else False
|
| 94 |
for x in hits['Sector Label']])
|
| 95 |
+
|
| 96 |
+
# count_df = df['Target Label'].value_counts()
|
| 97 |
+
# count_df = count_df.rename('count')
|
| 98 |
+
# count_df = count_df.rename_axis('Target Label').reset_index()
|
| 99 |
+
# count_df['Label_def'] = count_df['Target Label'].apply(lambda x: _lab_dict[x])
|
| 100 |
|
| 101 |
+
# fig = px.bar(count_df, y="Label_def", x="count", orientation='h', height=200)
|
| 102 |
+
c1, c2 = st.columns([1,1])
|
| 103 |
+
with c1:
|
| 104 |
+
st.write('**Target Paragraphs**: `{}`'.format(count_target))
|
| 105 |
+
st.write('**NetZero Related Paragraphs**: `{}`'.format(count_netzero))
|
| 106 |
+
|
| 107 |
+
# st.plotly_chart(fig,use_container_width= True)
|
| 108 |
+
|
| 109 |
+
# count_netzero = sum(hits['Netzero Label'] == 'NETZERO')
|
| 110 |
+
# count_ghg = sum(hits['GHG Label'] == 'LABEL_2')
|
| 111 |
+
# count_economy = sum([True if 'Economy-wide' in x else False
|
| 112 |
+
# for x in hits['Sector Label']])
|
| 113 |
with c2:
|
| 114 |
+
st.write('**GHG Related Paragraphs**: `{}`'.format(count_ghg))
|
| 115 |
+
st.write('**Economy-wide Related Paragraphs**: `{}`'.format(count_economy))
|
| 116 |
+
|
| 117 |
hits = hits.sort_values(by=['Relevancy'], ascending=False)
|
| 118 |
st.write("")
|
| 119 |
st.markdown("###### Top few Target Classified paragraph/text results ######")
|