| 168 | |
| 169 | |
| 170 | def generate_answer(question, cluster_chain_of_entities, args): |
| 171 | prompt = answer_prompt_wiki + question + '\n' |
| 172 | chain_prompt = '\n'.join([', '.join([str(x) for x in chain]) for sublist in cluster_chain_of_entities for chain in sublist]) |
| 173 | prompt += "\nKnowledge Triplets: " + chain_prompt + 'A: ' |
| 174 | result = run_llm(prompt, args.temperature_reasoning, args.max_length, args.opeani_api_keys, args.LLM_type) |
| 175 | return result |
| 176 | |
| 177 | |
| 178 | def entity_prune(total_entities_id, total_relations, total_candidates, total_topic_entities, total_head, total_scores, args, wiki_client): |