Skip to content

Commit

Permalink
fix: rewoo citation
Browse files Browse the repository at this point in the history
  • Loading branch information
taprosoft committed Oct 30, 2024
1 parent 66e5656 commit c321817
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libs/ktem/ktem/reasoning/rewoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,12 @@ def prepare_citation(self, answer) -> list[Document]:

if "citation" in answer.metadata and answer.metadata["citation"] is not None:
context = answer.metadata["worker_log"]
for fact_with_evidence in answer.metadata["citation"].answer:
for quote in fact_with_evidence.substring_quote:
matches = find_text(quote, context)
for match in matches:
split_indices.append(match[0])
split_indices.append(match[1])
start_indices.add(match[0])
for evidence in answer.metadata["citation"].evidences:
matches = find_text(evidence, context)
for match in matches:
split_indices.append(match[0])
split_indices.append(match[1])
start_indices.add(match[0])
split_indices = sorted(list(set(split_indices)))
spans = []
prev = 0
Expand Down

0 comments on commit c321817

Please sign in to comment.