akki2825 commited on
Commit
b19598b
·
verified ·
1 Parent(s): 01e4e5c

fix misaligned error

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -74,7 +74,7 @@ def calculate_sentence_metrics(reference, hypothesis):
74
  }
75
  except Exception as e:
76
  raise e
77
-
78
  def identify_misaligned_sentences(reference_text, hypothesis_text):
79
  """
80
  Identify sentences that don't match between reference and hypothesis.
@@ -194,7 +194,8 @@ def main():
194
  def process_and_display(ref_file, hyp_file):
195
  result = process_files(ref_file, hyp_file)
196
  if "error" in result:
197
- return {}, {}, {}, "Error: " + result["error"]
 
198
 
199
  metrics = {
200
  "Overall WER": result["Overall WER"],
 
74
  }
75
  except Exception as e:
76
  raise e
77
+
78
  def identify_misaligned_sentences(reference_text, hypothesis_text):
79
  """
80
  Identify sentences that don't match between reference and hypothesis.
 
194
  def process_and_display(ref_file, hyp_file):
195
  result = process_files(ref_file, hyp_file)
196
  if "error" in result:
197
+ error_msg = result["error"]
198
+ return {"error": error_msg}, "", "", {"error": error_msg}
199
 
200
  metrics = {
201
  "Overall WER": result["Overall WER"],