| 217 | |
| 218 | |
| 219 | def generate_answer(question, cluster_chain_of_entities, args): |
| 220 | prompt = answer_prompt + question + '\n' |
| 221 | chain_prompt = '\n'.join([', '.join([str(x) for x in chain]) for sublist in cluster_chain_of_entities for chain in sublist]) |
| 222 | prompt += "\nKnowledge Triplets: " + chain_prompt + 'A: ' |
| 223 | result = run_llm(prompt, args.temperature_reasoning, args.max_length, args.opeani_api_keys, args.LLM_type) |
| 224 | return result |
| 225 | |
| 226 | |
| 227 | def entity_prune(total_entities_id, total_relations, total_candidates, total_topic_entities, total_head, total_scores, args): |