refactor: improve type hints and clean up imports

This commit is contained in:
Barabazs
2025-01-13 08:28:27 +01:00
parent 73e644559d
commit f286e7f3de
5 changed files with 10 additions and 11 deletions

View File

@ -1,4 +1,4 @@
""""
"""
Forced Alignment with Whisper
C. Max Bain
"""
@ -14,7 +14,6 @@ from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
from .audio import SAMPLE_RATE, load_audio
from .utils import interpolate_nans
from .types import AlignedTranscriptionResult, SingleSegment, SingleAlignedSegment, SingleWordSegment
import nltk
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktParameters
PUNKT_ABBREVIATIONS = ['dr', 'vs', 'mr', 'mrs', 'prof']
@ -194,6 +193,7 @@ def align(
"end": t2,
"text": text,
"words": [],
"chars": None,
}
if return_char_alignments: