def build_summary(self, input_df, ndarray_data): cols = [f for f in input_df.columns.tolist() if f.startswith("f:")] X = input_df[cols].values input_df["rank"] = (X / X.max(axis=0)).mean(axis=1) output_df = input_df.sort(["rank"], ascending=False) return Summary(output_df)
def build_summary(self, input_df, ndarray_data): output_df = input_df[input_df["f:monotone-submod"] == 1] output_df = output_df.sort_values(["doc id", "sent id"], ascending=True) return Summary(output_df)
def build_summary(self, input_df, ndarray_data): output_df = input_df[input_df["f:submodular-mmr"].isnull() == False] output_df = output_df.sort_values(["doc id", "sent id"], ascending=True) print(output_df) print(output_df['sent text'].apply(len)) return Summary(output_df)
def build_summary(self, input_df, ndarray_data): output_df = input_df.sort_values(["f:mmr"], ascending=False) return Summary(output_df)
def build_summary(self, input_df, ndarray_data): output_df = input_df[input_df[u"f:lede"] == 1].sort_values( ["doc id"], ascending=True) return Summary(output_df)
def build_summary(self, input_df, ndarray_data): output_df = input_df.sort(["f:lexrank"], ascending=False) return Summary(output_df)