ppsingh commited on
Commit
2c93873
1 Parent(s): 53dc094

add policy action

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  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, target_extraction.app, netzero.app, ghg.app,
64
- policyaction.app, indicator.app, conditional.app, sector.app]
 
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