From ab68b13954e47675c8b20b44142acba91770e001 Mon Sep 17 00:00:00 2001 From: qingzhong1 Date: Wed, 17 Jan 2024 03:19:49 +0000 Subject: [PATCH] add fact_check_agent --- .../applications/erniebot_researcher/fact_check_agent.py | 6 ++++-- .../erniebot_researcher/sample_report_example.py | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py b/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py index 2a2f133e..02a0918f 100644 --- a/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py +++ b/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py @@ -104,8 +104,10 @@ async def check_claim(self, question: str, answer: str, claim: str): async def verifications(self, facts_problems: List[dict]): """ - Use external knowledge to answer facts to answer questions, - and use the answers to questions to determine whether the facts are correct + Answer questions using external knowledge and then use the answers to the questions to verify + relevant facts. As it processes each question and fact pair, it obtains the context + relevant to the question, generates an answer to the question, checks whether the fact + is correct, and records the verification results. """ for item in facts_problems: question = item["question"] diff --git a/erniebot-agent/applications/erniebot_researcher/sample_report_example.py b/erniebot-agent/applications/erniebot_researcher/sample_report_example.py index 12018c86..bf9d1bf3 100644 --- a/erniebot-agent/applications/erniebot_researcher/sample_report_example.py +++ b/erniebot-agent/applications/erniebot_researcher/sample_report_example.py @@ -161,11 +161,7 @@ def get_agents(retriever_sets, tool_sets, llm, llm_long): dir_path=target_path, report_type=args.report_type, ) - checker_actor = FactCheckerAgent( - name="fact_check", - llm=llm, - retriever_db=retriever_sets["full_text"] - ) + checker_actor = FactCheckerAgent(name="fact_check", llm=llm, retriever_db=retriever_sets["full_text"]) ranker_actor = RankingAgent( llm=llm, llm_long=llm_long,