Skip to content

Commit

Permalink
test timing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Apr 8, 2024
1 parent 3dc3b74 commit 495064e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion batchalign/pipelines/fa/whisper_fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def process(self, doc:Document, **kwargs):
# perform alignment
# we take a 2 second buffer in each direction
try:
detokenized = detokenize(word[0].text for word in grp)
# replace ANY punctuation
for i in MOR_PUNCT + ENDING_PUNCT:
detokenized = detokenized.replace(i, "").strip()
res = self.__whisper(audio=f.chunk(grp[0][1][0], grp[-1][1][1]),
text=detokenize(word[0].text for word in grp))
text=detokenized)
except IndexError:
# utterance contains nothing
continue
Expand Down Expand Up @@ -137,6 +141,7 @@ def process(self, doc:Document, **kwargs):
# if we ended up with timings that don't make sense, drop it
if w.time and w.time[0] >= w.time[1]:
w.time = None

# clear any built-in timing (i.e. we should use utterance-derived timing)
ut.time = None
# correct the text
Expand Down
6 changes: 3 additions & 3 deletions batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.7.0-beta.2
Apr 05, 2024
Disables %wor line by default in transcribe
0.7.0-beta.3
Apr 08, 2024
Patched end punctuation timing bug

0 comments on commit 495064e

Please sign in to comment.