akki2825 commited on
Commit
047167d
·
verified ·
1 Parent(s): e3737ef

fix index error

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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({