Spaces:
Sleeping
Sleeping
fix index error
Browse files
app.py
CHANGED
@@ -88,6 +88,7 @@ def identify_misaligned_sentences(reference_text, hypothesis_text):
|
|
88 |
hypothesis_sentences = split_into_sentences(hypothesis_text)
|
89 |
|
90 |
misaligned = []
|
|
|
91 |
for i, (ref, hyp) in enumerate(zip(reference_sentences, hypothesis_sentences)):
|
92 |
if ref != hyp:
|
93 |
# Split sentences into words
|
@@ -117,8 +118,7 @@ def identify_misaligned_sentences(reference_text, hypothesis_text):
|
|
117 |
"context_ref": context_ref,
|
118 |
"context_hyp": context_hyp
|
119 |
})
|
120 |
-
|
121 |
-
# Handle cases where the number of sentences differs
|
122 |
if len(reference_sentences) > len(hypothesis_sentences):
|
123 |
for i in range(len(hypothesis_sentences), len(reference_sentences)):
|
124 |
misaligned.append({
|
|
|
88 |
hypothesis_sentences = split_into_sentences(hypothesis_text)
|
89 |
|
90 |
misaligned = []
|
91 |
+
|
92 |
for i, (ref, hyp) in enumerate(zip(reference_sentences, hypothesis_sentences)):
|
93 |
if ref != hyp:
|
94 |
# Split sentences into words
|
|
|
118 |
"context_ref": context_ref,
|
119 |
"context_hyp": context_hyp
|
120 |
})
|
121 |
+
|
|
|
122 |
if len(reference_sentences) > len(hypothesis_sentences):
|
123 |
for i in range(len(hypothesis_sentences), len(reference_sentences)):
|
124 |
misaligned.append({
|