k2py 0.2.1__cp311-cp311-win_amd64.whl → 0.2.2__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
k2py/__init__.py CHANGED
@@ -69,9 +69,10 @@ def AlignSegments(
69
69
  min_active_states: int,
70
70
  max_active_states: int,
71
71
  use_double_scores: bool = True,
72
+ allow_partial: bool = True,
72
73
  ) -> Tuple[List[List["AlignedToken"]], List[List[int]]]:
73
74
  """Align segments using offline dense intersection.
74
-
75
+
75
76
  Args:
76
77
  graph_result: Dictionary returned by CreateFsaVecFromStr
77
78
  scores: Numpy array of scores (rows, cols)
@@ -80,14 +81,16 @@ def AlignSegments(
80
81
  min_active_states: Minimum active states
81
82
  max_active_states: Maximum active states
82
83
  use_double_scores: Whether to use double precision for scores
83
-
84
+ allow_partial: If True, treat all states on last frame as final
85
+ when no final state is active. Default True.
86
+
84
87
  Returns:
85
88
  A tuple containing:
86
89
  - results: List of List of AlignedToken objects (wrapped in list for batch consistency)
87
90
  - labels: List of List of timestamps (wrapped in list for batch consistency)
88
91
  """
89
92
  from ._k2 import AlignSegments as _AlignSegments
90
-
93
+
91
94
  final_result = _AlignSegments(
92
95
  graph_result,
93
96
  scores,
@@ -95,7 +98,8 @@ def AlignSegments(
95
98
  output_beam,
96
99
  min_active_states,
97
100
  max_active_states,
98
- use_double_scores
101
+ use_double_scores,
102
+ allow_partial,
99
103
  )
100
104
 
101
105
  # Convert to AlignedToken objects
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: k2py
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Python bindings for k2
5
5
  Keywords: k2,forced-alignment,speech,asr
6
6
  Author: The LattifAI Development Team
@@ -0,0 +1,5 @@
1
+ k2py/__init__.py,sha256=uL7PzO4GaOn18UCSOGd9UYBtcUblvpAeRUhIs4Sa6Y8,4334
2
+ k2py/_k2.cp311-win_amd64.pyd,sha256=VC3w_ZqGlGoAiltoHbHDgnvgOEKE4-FlW8GgkBOXsbs,673792
3
+ k2py-0.2.2.dist-info/METADATA,sha256=r0vfmrD2qwHeM7uJeX3PBB4w-880yjV05NX4u8JXrzs,2306
4
+ k2py-0.2.2.dist-info/WHEEL,sha256=oXhHG6ewLm-FNdEna2zwgy-K0KEl4claZ1ztR4VTx0I,106
5
+ k2py-0.2.2.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- k2py/__init__.py,sha256=fD-0RgkT-0zda8QSVWiDkTnRqyvgv3t9ZejCFdB4qRU,4151
2
- k2py/_k2.cp311-win_amd64.pyd,sha256=BJV8gEloWl8xI6PolsxaKhBKuyr8THPoEXP1vh1gz6c,673280
3
- k2py-0.2.1.dist-info/METADATA,sha256=WZj7TvtzS_CVPsCWiQexJhu2JIE727HBgur1ZuCBatw,2306
4
- k2py-0.2.1.dist-info/WHEEL,sha256=oXhHG6ewLm-FNdEna2zwgy-K0KEl4claZ1ztR4VTx0I,106
5
- k2py-0.2.1.dist-info/RECORD,,
File without changes