Spaces:
GIZ
/
Running on CPU Upgrade

prashant commited on
Commit
3a3fd67
1 Parent(s): 8ee6037

keywords by sdg proportion

Browse files
appStore/sdg_analysis.py CHANGED
@@ -108,7 +108,7 @@ def app():
108
  with st.spinner("Running SDG Classification{}".format(warning_msg)):
109
 
110
  df, x = sdg_classification(allDocuments['documents'])
111
- sdg_labels = df.SDG.unique()
112
  textrankkeywordlist = []
113
  for label in sdg_labels:
114
  sdgdata = " ".join(df[df.SDG == label].text.to_list())
 
108
  with st.spinner("Running SDG Classification{}".format(warning_msg)):
109
 
110
  df, x = sdg_classification(allDocuments['documents'])
111
+ sdg_labels = x.count.unique()
112
  textrankkeywordlist = []
113
  for label in sdg_labels:
114
  sdgdata = " ".join(df[df.SDG == label].text.to_list())
utils/sdg_classifier.py CHANGED
@@ -96,7 +96,7 @@ def sdg_classification(haystackdoc:List[Document])->Tuple[DataFrame,Series]:
96
  x = x.rename('count')
97
  x = x.rename_axis('SDG').reset_index()
98
  x["SDG"] = pd.to_numeric(x["SDG"])
99
- x = x.sort_values(by=['SDG'])
100
  x['SDG_name'] = x['SDG'].apply(lambda x: _lab_dict[x])
101
  x['SDG'] = x['SDG'].apply(lambda x: "SDG "+str(x))
102
  df= df.drop(['Relevancy'], axis = 1)
 
96
  x = x.rename('count')
97
  x = x.rename_axis('SDG').reset_index()
98
  x["SDG"] = pd.to_numeric(x["SDG"])
99
+ x = x.sort_values(by=['count'])
100
  x['SDG_name'] = x['SDG'].apply(lambda x: _lab_dict[x])
101
  x['SDG'] = x['SDG'].apply(lambda x: "SDG "+str(x))
102
  df= df.drop(['Relevancy'], axis = 1)