Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,12 @@ import appStore.sector as sector
|
|
4 |
import appStore.adapmit as adapmit
|
5 |
import appStore.ghg as ghg
|
6 |
import appStore.policyaction as policyaction
|
|
|
7 |
import appStore.indicator as indicator
|
|
|
8 |
import appStore.doc_processing as processing
|
9 |
from utils.uploadAndExample import add_upload
|
|
|
10 |
import streamlit as st
|
11 |
|
12 |
st.set_page_config(page_title = 'Climate Policy Intelligence',
|
@@ -32,29 +35,69 @@ with st.expander("ℹ️ - About this app", expanded=False):
|
|
32 |
digital tool which aims to assist policy analysts and \
|
33 |
other users in extracting and filtering relevant \
|
34 |
information from public documents.
|
35 |
-
|
36 |
-
What Happens in background?
|
37 |
-
|
38 |
-
- Step 1: Once the document is provided to app, it undergoes *Pre-processing*.\
|
39 |
-
In this step the document is broken into smaller paragraphs \
|
40 |
-
(based on word/sentence count).
|
41 |
-
- Step 2: The paragraphs are fed to **Target Classifier** which detects if
|
42 |
-
the paragraph contains any *Target* related information or not.
|
43 |
-
- Step 3: The paragraphs which are detected containing some target \
|
44 |
-
related information are then fed to multiple classifier to enrich the
|
45 |
-
Information Extraction.
|
46 |
-
|
47 |
-
Classifers:
|
48 |
-
- **Netzero**: Detects if any Netzero commitment is present in paragraph or not.
|
49 |
-
- **GHG**: Detects if any GHG related information present in paragraph or not.
|
50 |
-
- **Sector**: Detects which sectors are spoken/discussed about in paragraph.
|
51 |
-
- **Adaptation-Mitigation**: Detects if the paragraph is related to Adaptation and/or Mitigation.
|
52 |
-
|
53 |
-
|
54 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
st.write("")
|
56 |
apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
|
57 |
-
|
|
|
58 |
multiplier_val =1/len(apps)
|
59 |
if st.button("Analyze Document"):
|
60 |
prg = st.progress(0.0)
|
|
|
4 |
import appStore.adapmit as adapmit
|
5 |
import appStore.ghg as ghg
|
6 |
import appStore.policyaction as policyaction
|
7 |
+
import appStore.conditional as conditional
|
8 |
import appStore.indicator as indicator
|
9 |
+
import appStore.reader as reader
|
10 |
import appStore.doc_processing as processing
|
11 |
from utils.uploadAndExample import add_upload
|
12 |
+
from PIL import Image
|
13 |
import streamlit as st
|
14 |
|
15 |
st.set_page_config(page_title = 'Climate Policy Intelligence',
|
|
|
35 |
digital tool which aims to assist policy analysts and \
|
36 |
other users in extracting and filtering relevant \
|
37 |
information from public documents.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
""")
|
39 |
+
st.write('**Definitions**')
|
40 |
+
|
41 |
+
st.caption("""
|
42 |
+
- **Target**: Targets are an intention to achieve a specific result, \
|
43 |
+
for example, to reduce GHG emissions to a specific level \
|
44 |
+
(a GHG target) or increase energy efficiency or renewable \
|
45 |
+
energy to a specific level (a non-GHG target), typically by \
|
46 |
+
a certain date.
|
47 |
+
- **Economy-wide Target**: Certain Target are applicable \
|
48 |
+
not at specific Sector level but are applicable at economic \
|
49 |
+
wide scale.
|
50 |
+
- **Netzero**: Identifies if its Netzero Target or not.
|
51 |
+
- 'NET-ZERO': target_labels = ['T_Netzero','T_Netzero_C']
|
52 |
+
- 'Non Netzero Target': target_labels_neg = ['T_Economy_C',
|
53 |
+
'T_Economy_Unc','T_Adaptation_C','T_Adaptation_Unc','T_Transport_C',
|
54 |
+
'T_Transport_O_C','T_Transport_O_Unc','T_Transport_Unc']
|
55 |
+
- 'Others': Other Targets beside covered above
|
56 |
+
- **GHG Target**: GHG targets refer to contributions framed as targeted \
|
57 |
+
outcomes in GHG terms.
|
58 |
+
- 'GHG': target_labels_ghg_yes = ['T_Transport_Unc','T_Transport_C']
|
59 |
+
- 'NON GHG TRANSPORT TARGET': target_labels_ghg_no = ['T_Adaptation_Unc',\
|
60 |
+
'T_Adaptation_C', 'T_Transport_O_Unc', 'T_Transport_O_C']
|
61 |
+
- 'OTHERS': Other Targets beside covered above.
|
62 |
+
- **Conditionality**: An “unconditional contribution” is what countries \
|
63 |
+
could implement without any conditions and based on their own \
|
64 |
+
resources and capabilities. A “conditional contribution” is one \
|
65 |
+
that countries would undertake if international means of support \
|
66 |
+
are provided, or other conditions are met.
|
67 |
+
- **Action**: Actions are an intention to implement specific means of \
|
68 |
+
achieving GHG reductions, usually in forms of concrete projects.
|
69 |
+
- **Policies and Plans**: Policies are domestic planning documents \
|
70 |
+
such as policies, regulations or guidlines, and Plans are broader \
|
71 |
+
than specific policies or actions, such as a general intention \
|
72 |
+
to ‘improve efficiency’, ‘develop renewable energy’, etc. \
|
73 |
+
The terms come from the World Bank's NDC platform and WRI's publication.
|
74 |
+
""")
|
75 |
+
c1, c2, c3 = st.columns([12,1,10])
|
76 |
+
with c1:
|
77 |
+
image = Image.open('docStore/img/flow.jpg')
|
78 |
+
st.image(image)
|
79 |
+
with c3:
|
80 |
+
st.write("""
|
81 |
+
What Happens in background?
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
- Step 1: Once the document is provided to app, it undergoes *Pre-processing*.\
|
86 |
+
In this step the document is broken into smaller paragraphs \
|
87 |
+
(based on word/sentence count).
|
88 |
+
- Step 2: The paragraphs are fed to **Target Classifier** which detects if
|
89 |
+
the paragraph contains any *Target* related information or not.
|
90 |
+
- Step 3: The paragraphs which are detected containing some target \
|
91 |
+
related information are then fed to multiple classifier to enrich the
|
92 |
+
Information Extraction.
|
93 |
+
|
94 |
+
The Step 2 and 3 are repated then similarly for Action and Policies & Plans.
|
95 |
+
""")
|
96 |
+
|
97 |
st.write("")
|
98 |
apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
|
99 |
+
policyaction.app, conditional.app, sector.app, adapmit.app,indicator.app]
|
100 |
+
|
101 |
multiplier_val =1/len(apps)
|
102 |
if st.button("Analyze Document"):
|
103 |
prg = st.progress(0.0)
|