AliJabbarpour commited on
Commit
91cc478
·
verified ·
1 Parent(s): 9f46420

Update pipeline/postprocess.py

Browse files
Files changed (1) hide show
  1. pipeline/postprocess.py +2 -3
pipeline/postprocess.py CHANGED
@@ -37,9 +37,8 @@ def merge_segments(segments: list) -> list:
37
  combined_duration = seg["end"] - current["start"]
38
  ends_sentence = current["text"].rstrip().endswith((".", "!", "?"))
39
 
40
- # segment کوتاه (کمتر از ۳ کلمه یا کمتر از ۰.۸ ثانیه) → همیشه merge کن
41
- current_words = current.get("words", [])
42
- is_short = len(current_words) <= 2 or (current["end"] - current["start"]) < 0.8
43
 
44
  should_merge = (
45
  not ends_sentence
 
37
  combined_duration = seg["end"] - current["start"]
38
  ends_sentence = current["text"].rstrip().endswith((".", "!", "?"))
39
 
40
+ current_duration = current["end"] - current["start"]
41
+ is_short = current_duration < 1.5
 
42
 
43
  should_merge = (
44
  not ends_sentence