def compute_upper_bound(docs, evaluation_info, length, iterations, population_size, THRESHOLD): sim_mat = evaluation_info['sim_matrix']['sim_mat'].T SCU_Props = evaluation_info['sim_matrix']['SCUProps'] Source_Props = evaluation_info['sim_matrix']['SourceProps'] sentences = [] for _, doc in docs: for s in doc: sentences.append(s) sentences = clean_sentences(sentences, Source_Props, sim_mat, THRESHOLD) gen_opt = GeneticAlgorithm.GeneticOptimizer( PEAK.PEAK, sentences, evaluation_info, length, population_size=population_size, survival_rate=0.4, mutation_rate=0.2, reproduction_rate=0.4, THRESHOLD=THRESHOLD, maximization=True) summary, score = gen_opt.evolve(iterations) text_summary = [] for s in summary: text_summary.append(s.get_text()) return text_summary