lyrics-transcriber 0.34.0__py3-none-any.whl → 0.34.1__py3-none-any.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.
- lyrics_transcriber/correction/handlers/syllables_match.py +22 -2
- {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/METADATA +1 -1
- {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/RECORD +6 -6
- {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/LICENSE +0 -0
- {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/WHEEL +0 -0
- {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/entry_points.txt +0 -0
@@ -16,22 +16,42 @@ class SyllablesMatchHandler(GapCorrectionHandler):
|
|
16
16
|
"""Handles gaps where number of syllables in reference text matches number of syllables in transcription."""
|
17
17
|
|
18
18
|
def __init__(self):
|
19
|
+
# Initialize logger first
|
20
|
+
self.logger = logging.getLogger(__name__)
|
21
|
+
|
19
22
|
# Marking SpacySyllables as used to prevent unused import warning
|
20
23
|
_ = SpacySyllables
|
24
|
+
|
21
25
|
# Load spacy model with syllables pipeline
|
22
|
-
|
26
|
+
try:
|
27
|
+
self.nlp = spacy.load("en_core_web_sm")
|
28
|
+
except OSError:
|
29
|
+
self.logger.info("Language model 'en_core_web_sm' not found. Attempting to download...")
|
30
|
+
import subprocess
|
31
|
+
|
32
|
+
try:
|
33
|
+
subprocess.check_call(["python", "-m", "spacy", "download", "en_core_web_sm"])
|
34
|
+
self.nlp = spacy.load("en_core_web_sm")
|
35
|
+
self.logger.info("Successfully downloaded and loaded en_core_web_sm")
|
36
|
+
except subprocess.CalledProcessError as e:
|
37
|
+
raise OSError(
|
38
|
+
"Language model 'en_core_web_sm' could not be downloaded. "
|
39
|
+
"Please install it manually with: python -m spacy download en_core_web_sm"
|
40
|
+
) from e
|
41
|
+
|
23
42
|
# Add syllables component to pipeline if not already present
|
24
43
|
if "syllables" not in self.nlp.pipe_names:
|
25
44
|
self.nlp.add_pipe("syllables", after="tagger")
|
45
|
+
|
26
46
|
# Initialize Pyphen for English
|
27
47
|
self.dic = pyphen.Pyphen(lang="en_US")
|
48
|
+
|
28
49
|
# Initialize NLTK's CMU dictionary
|
29
50
|
try:
|
30
51
|
self.cmudict = cmudict.dict()
|
31
52
|
except LookupError:
|
32
53
|
nltk.download("cmudict")
|
33
54
|
self.cmudict = cmudict.dict()
|
34
|
-
self.logger = logging.getLogger(__name__)
|
35
55
|
|
36
56
|
def _count_syllables_spacy(self, words: List[str]) -> int:
|
37
57
|
"""Count syllables using spacy_syllables."""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: lyrics-transcriber
|
3
|
-
Version: 0.34.
|
3
|
+
Version: 0.34.1
|
4
4
|
Summary: Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify
|
5
5
|
License: MIT
|
6
6
|
Author: Andrew Beveridge
|
@@ -14,7 +14,7 @@ lyrics_transcriber/correction/handlers/no_space_punct_match.py,sha256=ri4QEdkYss
|
|
14
14
|
lyrics_transcriber/correction/handlers/relaxed_word_count_match.py,sha256=Y_4S8orGx1LQzlr2yCrGYkvtVLzjD31urtW9tkbwado,2474
|
15
15
|
lyrics_transcriber/correction/handlers/repeat.py,sha256=jeUwpgU3no1Stk7bOHweDfIOxM2xsykbttdnsD-e_Rg,3682
|
16
16
|
lyrics_transcriber/correction/handlers/sound_alike.py,sha256=mAmnpRpO29rHaP96V-U3QTS1aOM32IV2YUYgS0y9ibo,10635
|
17
|
-
lyrics_transcriber/correction/handlers/syllables_match.py,sha256=
|
17
|
+
lyrics_transcriber/correction/handlers/syllables_match.py,sha256=wB42wDfsx_3z2kcciuUy9Rs45NCPSTIQGHLP8DV0TnE,9129
|
18
18
|
lyrics_transcriber/correction/handlers/word_count_match.py,sha256=zbyZ01VE_6azaFpi8rS0Ato7c_VBxM2KV83VnDH5t3c,2522
|
19
19
|
lyrics_transcriber/correction/handlers/word_operations.py,sha256=2COTaJsEwpSWyXHXmGgjfcf2x7tbAnsQ0dIW0qyHYK4,5141
|
20
20
|
lyrics_transcriber/correction/phrase_analyzer.py,sha256=dtO_2LjxnPdHJM7De40mYIdHCkozwhizVVQp5XGO7x0,16962
|
@@ -79,8 +79,8 @@ lyrics_transcriber/transcribers/audioshake.py,sha256=QzKGimVa6BovlvYFj35CbGpaGeP
|
|
79
79
|
lyrics_transcriber/transcribers/base_transcriber.py,sha256=yPzUWPTCGmzE97H5Rz6g61e-qEGL77ZzUoiBOmswhts,5973
|
80
80
|
lyrics_transcriber/transcribers/whisper.py,sha256=P0kas2_oX16MO1-Qy7U5gl5KQN-RuUIJZz7LsEFLUiE,12906
|
81
81
|
lyrics_transcriber/types.py,sha256=xGf3hkTRcGZTTAjMVIev2i2DOU6co0QGpW8NxvaBQAA,16759
|
82
|
-
lyrics_transcriber-0.34.
|
83
|
-
lyrics_transcriber-0.34.
|
84
|
-
lyrics_transcriber-0.34.
|
85
|
-
lyrics_transcriber-0.34.
|
86
|
-
lyrics_transcriber-0.34.
|
82
|
+
lyrics_transcriber-0.34.1.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
|
83
|
+
lyrics_transcriber-0.34.1.dist-info/METADATA,sha256=yMa49bGqpbhQfdtg2Nf55M1ZGPL5ptAzdvh4TK_rsFM,5856
|
84
|
+
lyrics_transcriber-0.34.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
85
|
+
lyrics_transcriber-0.34.1.dist-info/entry_points.txt,sha256=ChnmR13YoalGnC3sHW0TppX5FbhEXntYIha24tVQJ1M,104
|
86
|
+
lyrics_transcriber-0.34.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.1.dist-info}/entry_points.txt
RENAMED
File without changes
|