fix: rewoo citation (#441) #none
This commit is contained in:
parent
66e565649e
commit
280f0d58ce
|
@ -271,13 +271,12 @@ class RewooAgentPipeline(BaseReasoning):
|
||||||
|
|
||||||
if "citation" in answer.metadata and answer.metadata["citation"] is not None:
|
if "citation" in answer.metadata and answer.metadata["citation"] is not None:
|
||||||
context = answer.metadata["worker_log"]
|
context = answer.metadata["worker_log"]
|
||||||
for fact_with_evidence in answer.metadata["citation"].answer:
|
for evidence in answer.metadata["citation"].evidences:
|
||||||
for quote in fact_with_evidence.substring_quote:
|
matches = find_text(evidence, context)
|
||||||
matches = find_text(quote, context)
|
for match in matches:
|
||||||
for match in matches:
|
split_indices.append(match[0])
|
||||||
split_indices.append(match[0])
|
split_indices.append(match[1])
|
||||||
split_indices.append(match[1])
|
start_indices.add(match[0])
|
||||||
start_indices.add(match[0])
|
|
||||||
split_indices = sorted(list(set(split_indices)))
|
split_indices = sorted(list(set(split_indices)))
|
||||||
spans = []
|
spans = []
|
||||||
prev = 0
|
prev = 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user