add policy action
Browse files- app.py +3 -2
- utils/policyaction_classifier.py +3 -6
app.py
CHANGED
@@ -60,8 +60,9 @@ with st.expander("ℹ️ - About this app", expanded=False):
|
|
60 |
not at specific Sector level but are applicable at economic \
|
61 |
wide scale. """)
|
62 |
st.write("")
|
63 |
-
apps = [processing.app,
|
64 |
-
|
|
|
65 |
#adapmit.app]
|
66 |
|
67 |
# policyaction.app, indicator.app, ]
|
|
|
60 |
not at specific Sector level but are applicable at economic \
|
61 |
wide scale. """)
|
62 |
st.write("")
|
63 |
+
apps = [processing.app, policyaction.app]
|
64 |
+
#target_extraction.app, netzero.app, ghg.app,
|
65 |
+
# policyaction.app, indicator.app, conditional.app, sector.app]
|
66 |
#adapmit.app]
|
67 |
|
68 |
# policyaction.app, indicator.app, ]
|
utils/policyaction_classifier.py
CHANGED
@@ -8,11 +8,6 @@ from utils.preprocessing import processingpipeline
|
|
8 |
import streamlit as st
|
9 |
from transformers import pipeline
|
10 |
|
11 |
-
## Labels dictionary ###
|
12 |
-
_lab_dict = {
|
13 |
-
'NEGATIVE':'NO TARGET INFO',
|
14 |
-
'TARGET':'TARGET',
|
15 |
-
}
|
16 |
|
17 |
@st.cache_resource
|
18 |
def load_policyactionClassifier(config_file:str = None, classifier_name:str = None):
|
@@ -93,9 +88,11 @@ def policyaction_classification(haystack_doc:pd.DataFrame,
|
|
93 |
categories = list(truth_df.columns)
|
94 |
truth_df['Policy-Action Label'] = truth_df.apply(lambda x: {i if x[i]=='True'
|
95 |
else None for i in categories}, axis=1)
|
|
|
96 |
truth_df['Policy-Action Label'] = truth_df.apply(lambda x:
|
97 |
list(x['Policy-Action Label'] -{None}),axis=1)
|
98 |
|
99 |
-
haystack_doc['Policy-Action Label'] = list(truth_df['Policy-Action Label'])
|
|
|
100 |
|
101 |
return haystack_doc
|
|
|
8 |
import streamlit as st
|
9 |
from transformers import pipeline
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
@st.cache_resource
|
13 |
def load_policyactionClassifier(config_file:str = None, classifier_name:str = None):
|
|
|
88 |
categories = list(truth_df.columns)
|
89 |
truth_df['Policy-Action Label'] = truth_df.apply(lambda x: {i if x[i]=='True'
|
90 |
else None for i in categories}, axis=1)
|
91 |
+
st.dataframe(truth_df)
|
92 |
truth_df['Policy-Action Label'] = truth_df.apply(lambda x:
|
93 |
list(x['Policy-Action Label'] -{None}),axis=1)
|
94 |
|
95 |
+
haystack_doc['Policy-Action Label'] = list(truth_df['Policy-Action Label'])
|
96 |
+
st.dataframe(haystack_doc)
|
97 |
|
98 |
return haystack_doc
|