Skip to content

Commit c32c144

Browse files
committed
fix: transcript params
1 parent f88f4d5 commit c32c144

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

videodb/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" About information for videodb sdk"""
22

33

4-
__version__ = "0.2.3"
4+
__version__ = "0.2.4"
55
__title__ = "videodb"
66
__author__ = "videodb"
77
__email__ = "contact@videodb.io"

videodb/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SceneExtractionType,
1212
MediaType,
1313
SearchType,
14+
Segmenter,
1415
SubtitleAlignment,
1516
SubtitleBorderStyle,
1617
SubtitleStyle,
@@ -41,6 +42,7 @@
4142
"SubtitleStyle",
4243
"TextStyle",
4344
"SceneExtractionType",
45+
"Segmenter",
4446
]
4547

4648

videodb/_constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ class SemanticSearchDefaultValues:
3636
score_threshold = 0.2
3737

3838

39+
class Segmenter:
40+
time = "time"
41+
word = "word"
42+
sentence = "sentence"
43+
44+
3945
class ApiPath:
4046
collection = "collection"
4147
upload = "upload"

videodb/video.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
IndexType,
66
SceneExtractionType,
77
SearchType,
8+
Segmenter,
89
SubtitleStyle,
910
Workflows,
1011
)
@@ -128,16 +129,16 @@ def _fetch_transcript(
128129
self,
129130
start: int = None,
130131
end: int = None,
131-
segmenter: str = None,
132-
count: int = None,
132+
segmenter: str = Segmenter.word,
133+
length: int = 1,
133134
force: bool = None,
134135
) -> None:
135136
if (
136137
self.transcript
137138
and not start
138139
and not end
139140
and not segmenter
140-
and not count
141+
and not length
141142
and not force
142143
):
143144
return
@@ -147,7 +148,7 @@ def _fetch_transcript(
147148
"start": start,
148149
"end": end,
149150
"segmenter": segmenter,
150-
"count": count,
151+
"length": length,
151152
"force": "true" if force else "false",
152153
},
153154
show_progress=True,
@@ -159,25 +160,25 @@ def get_transcript(
159160
self,
160161
start: int = None,
161162
end: int = None,
162-
segmenter: str = None,
163-
count: int = None,
163+
segmenter: str = Segmenter.word,
164+
length: int = 1,
164165
force: bool = None,
165166
) -> List[Dict]:
166167
self._fetch_transcript(
167-
start=start, end=end, segmenter=segmenter, count=count, force=force
168+
start=start, end=end, segmenter=segmenter, length=length, force=force
168169
)
169170
return self.transcript
170171

171172
def get_transcript_text(
172173
self,
173174
start: int = None,
174175
end: int = None,
175-
segmenter: str = None,
176-
count: int = None,
176+
segmenter: str = Segmenter.word,
177+
length: int = 1,
177178
force: bool = None,
178179
) -> str:
179180
self._fetch_transcript(
180-
start=start, end=end, segmenter=segmenter, count=count, force=force
181+
start=start, end=end, segmenter=segmenter, length=length, force=force
181182
)
182183
return self.transcript_text
183184

0 commit comments

Comments
 (0)