colab-user commited on
Commit
f751237
·
1 Parent(s): af09bea

fix merge segments

Browse files
Files changed (2) hide show
  1. app/core/config.py +2 -2
  2. app/services/alignment.py +4 -4
app/core/config.py CHANGED
@@ -63,8 +63,8 @@ class Settings(BaseSettings):
63
  vad_min_silence_duration_ms: int = 800
64
 
65
  # Post-processing
66
- merge_threshold_s: float = 0.5 # Merge segments from same speaker if gap < this
67
- min_segment_duration_s: float = 0.3 # Remove segments shorter than this
68
 
69
  # Transcribe
70
  CONTEXT_WINDOW_S: int = 20
 
63
  vad_min_silence_duration_ms: int = 800
64
 
65
  # Post-processing
66
+ merge_threshold_s: float = 0.30 # Merge segments from same speaker if gap < this
67
+ min_segment_duration_s: float = 0.35 # Remove segments shorter than this
68
 
69
  # Transcribe
70
  CONTEXT_WINDOW_S: int = 20
app/services/alignment.py CHANGED
@@ -33,11 +33,11 @@ class AlignmentService:
33
  Uses word-center-based algorithm for accurate speaker-to-text mapping.
34
  """
35
 
36
- PAUSE_THRESHOLD = 1.0
37
- CENTER_TOL = 0.18 # ms
38
- OVERLAP_TH = 0.25 # > x% segments
39
  DIA_MERGE_GAP = 0.25
40
- MAX_SEGMENT_DURATION = 12.0
41
 
42
  @staticmethod
43
  def get_word_center(word: WordTimestamp) -> float:
 
33
  Uses word-center-based algorithm for accurate speaker-to-text mapping.
34
  """
35
 
36
+ PAUSE_THRESHOLD = 0.45
37
+ CENTER_TOL = 0.15 # ms
38
+ OVERLAP_TH = 0.20 # > x% segments
39
  DIA_MERGE_GAP = 0.25
40
+ MAX_SEGMENT_DURATION = 6.5
41
 
42
  @staticmethod
43
  def get_word_center(word: WordTimestamp) -> float: