Loading process_srl.py +2 −0 Original line number Diff line number Diff line Loading @@ -89,12 +89,14 @@ def cust(x): grs = pd.DataFrame() for n, gr in df.groupby(['bias', 'name_bias']): n_edit = '{}_coverage_of_{}_person'.format(n[0], n[1]) counts = gr.verb.value_counts() counts = counts / overall_counts.loc[counts.index] counts2 = overall_counts.loc[counts.index] counts.index += counts.apply(cust) counts.index += counts2.apply(cust) sorted_verbs = counts.sort_values(ascending=False).head(args.n) sorted_verbs.to_csv("{}.csv".format(n_edit)) grs[n] = sorted_verbs.index print(grs) grs.to_csv('most_freq_verbs.csv') Loading Loading
process_srl.py +2 −0 Original line number Diff line number Diff line Loading @@ -89,12 +89,14 @@ def cust(x): grs = pd.DataFrame() for n, gr in df.groupby(['bias', 'name_bias']): n_edit = '{}_coverage_of_{}_person'.format(n[0], n[1]) counts = gr.verb.value_counts() counts = counts / overall_counts.loc[counts.index] counts2 = overall_counts.loc[counts.index] counts.index += counts.apply(cust) counts.index += counts2.apply(cust) sorted_verbs = counts.sort_values(ascending=False).head(args.n) sorted_verbs.to_csv("{}.csv".format(n_edit)) grs[n] = sorted_verbs.index print(grs) grs.to_csv('most_freq_verbs.csv') Loading