ppsingh commited on
Commit
acff600
1 Parent(s): 6d737a4

statistics

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. appStore/target.py +10 -2
app.py CHANGED
@@ -34,11 +34,13 @@ with st.container():
34
  # st.write("")
35
  apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
36
  sector.app, adapmit.app]
37
- multiplier_val = int(100/len(apps))
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)
 
43
  if 'key1' in st.session_state:
 
44
  st.write(st.session_state.key1)
 
34
  # st.write("")
35
  apps = [processing.app, target_extraction.app, netzero.app, ghg.app,
36
  sector.app, adapmit.app]
37
+ multiplier_val = round(1/len(apps), 3)
38
  if st.button("Get the work done"):
39
+ prg = st.progress(0.0)
40
  for i,func in enumerate(apps):
41
  func()
42
  prg.progress((i+1)*multiplier_val)
43
+
44
  if 'key1' in st.session_state:
45
+ target_extraction.target_display()
46
  st.write(st.session_state.key1)
appStore/target.py CHANGED
@@ -97,15 +97,23 @@ def target_display():
97
  with c1:
98
  st.plotly_chart(fig,use_container_width= True)
99
 
 
 
 
 
 
 
 
 
 
100
  hits = hits.sort_values(by=['Relevancy'], ascending=False)
101
  st.write("")
102
- st.markdown("###### Top few Economy Wide Target Classified paragraph/text results ######")
103
  range_val = min(5,len(hits))
104
  for i in range(range_val):
105
  # the page number reflects the page that contains the main paragraph
106
  # according to split limit, the overlapping part can be on a separate page
107
  st.write('**Result {}** `page {}` (Relevancy Score: {:.2f})'.format(i+1,hits.iloc[i]['page'],hits.iloc[i]['Relevancy']))
108
  st.write("\t Text: \t{}".format(hits.iloc[i]['text'].replace("\n", " ")))
109
-
110
  else:
111
  st.info("🤔 No Targets found")
 
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('**NetZero Targets**: `{}`'.format(count_netzeo))
107
+ st.write('**GHG Targets**: `{}`'.format(count_ghg))
108
+ st.write('**Economy-wide Targets**: `{}`'.format(count_economy))
109
  hits = hits.sort_values(by=['Relevancy'], ascending=False)
110
  st.write("")
111
+ st.markdown("###### Top few Target Classified paragraph/text results ######")
112
  range_val = min(5,len(hits))
113
  for i in range(range_val):
114
  # the page number reflects the page that contains the main paragraph
115
  # according to split limit, the overlapping part can be on a separate page
116
  st.write('**Result {}** `page {}` (Relevancy Score: {:.2f})'.format(i+1,hits.iloc[i]['page'],hits.iloc[i]['Relevancy']))
117
  st.write("\t Text: \t{}".format(hits.iloc[i]['text'].replace("\n", " ")))
 
118
  else:
119
  st.info("🤔 No Targets found")