From 2b3870eea0a213e8784c568b97cc90e21fadde45 Mon Sep 17 00:00:00 2001 From: Faiz Surani Date: Sat, 15 Jun 2024 11:26:55 -0700 Subject: [PATCH] Fix sentence align bug --- rl/utils/locate_passage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rl/utils/locate_passage.py b/rl/utils/locate_passage.py index b984fd7..d98d6ad 100644 --- a/rl/utils/locate_passage.py +++ b/rl/utils/locate_passage.py @@ -116,8 +116,8 @@ def get_best_ngram_match( ) for sent in para["sentences"] ] - start = min(sentences, key=lambda s: abs(s.start - start)).start - end = max(sentences, key=lambda s: abs(s.end - end)).end + start = min(sentences, key=lambda s: abs(s.start - start))["start"] + end = max(sentences, key=lambda s: abs(s.end - end))["end"] return start, end