dh-mc commited on
Commit
e8b4f46
1 Parent(s): d9517a6

Update utils.py

Browse files
Files changed (1) hide show
  1. app_modules/utils.py +7 -0
app_modules/utils.py CHANGED
@@ -280,6 +280,13 @@ def detect_repetition_scores(text, debug=False):
280
  return pd.Series([newline_score, repetition_score, total_repetitions])
281
 
282
 
 
 
 
 
 
 
 
283
  def load_with_newline_and_repetition_scores(result_file, force_recalculate=False):
284
  print(f"loading result file: {result_file}")
285
  df = pd.read_csv(result_file, comment="#", on_bad_lines="warn")
 
280
  return pd.Series([newline_score, repetition_score, total_repetitions])
281
 
282
 
283
+ def detect_scores(text, debug=False):
284
+ newline_score, repetition_score, total_repetitions = detect_repetitions(
285
+ text, debug=debug
286
+ )
287
+ return pd.Series([newline_score, repetition_score, total_repetitions])
288
+
289
+
290
  def load_with_newline_and_repetition_scores(result_file, force_recalculate=False):
291
  print(f"loading result file: {result_file}")
292
  df = pd.read_csv(result_file, comment="#", on_bad_lines="warn")