mirror of
https://github.com/OpenSPG/KAG.git
synced 2025-06-27 03:20:08 +00:00
fix empty data generate (#319)
This commit is contained in:
parent
3348dfeaa4
commit
bd0c3ec92e
@ -390,15 +390,20 @@ class LFExecuteResult:
|
||||
|
||||
def get_support_facts(self):
|
||||
facts = []
|
||||
failed_sub_query = []
|
||||
if len(self.sub_plans) != 0:
|
||||
facts.append("sub query:")
|
||||
i = 0
|
||||
for sub_plan in self.sub_plans:
|
||||
sub_res = sub_plan.res
|
||||
if sub_res.sub_answer is None or "i don't know" in sub_res.sub_answer.lower() or sub_res.sub_answer == "":
|
||||
failed_sub_query.append(sub_res)
|
||||
facts.append(
|
||||
f"query{i + 1}:{sub_res.sub_query}. \nanswer:{sub_res.sub_answer}"
|
||||
)
|
||||
i += 1
|
||||
if len(failed_sub_query) == len(self.sub_plans) and len(self.rerank_docs) == 0:
|
||||
return ""
|
||||
if len(self.rerank_docs) != 0:
|
||||
facts.append("Passages:")
|
||||
facts += self.rerank_docs
|
||||
|
Loading…
x
Reference in New Issue
Block a user