Skip to content

Commit

Permalink
3.1.3 (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe authored Jul 16, 2024
1 parent c33e40e commit 78e481d
Show file tree
Hide file tree
Showing 75 changed files with 915 additions and 147 deletions.
14 changes: 13 additions & 1 deletion docs/source/changelog/changelog_3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@
3.0 Changelog
*************

3.1.1
3.1.3
-----

- Fixed an issue where silence probability being zero was not correctly removing silence
- Compatibility with kalpy v0.6.5
- Added API functionality for verifying transcripts with interjection words in alignment
- Fixed an error in fine tuning that generated nonsensical boundaries

3.1.2
-----

- Fixed a bug where hidden files and folders would be parsed as corpus data
- Fixed a bug where validation would not respect :code:`--no_final_clean`
- Fixed a rare crash in training when a job would not have utterances assigned to it
- Fixed a bug where MFA would mistakenly report a dictionary and acoustic model phones did not match for older versions

3.1.1
-----

- Fixed an issue with TextGrids missing intervals

3.1.0
-----
Expand Down
2 changes: 1 addition & 1 deletion montreal_forced_aligner/acoustic_modeling/lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def __init__(self, args: CalcLdaMlltArguments):
self.model_path = args.model_path
self.lda_options = args.lda_options

def _run(self) -> typing.Generator[int]:
def _run(self) -> None:
"""Run the function"""
# Estimating MLLT
with self.session() as session, thread_logger(
Expand Down
2 changes: 1 addition & 1 deletion montreal_forced_aligner/acoustic_modeling/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, args: TransitionAccArguments):
self.working_directory = args.working_directory
self.model_path = args.model_path

def _run(self) -> typing.Generator[typing.Tuple[int, str]]:
def _run(self) -> None:
"""Run the function"""

with self.session() as session:
Expand Down
2 changes: 1 addition & 1 deletion montreal_forced_aligner/acoustic_modeling/triphone.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, args: ConvertAlignmentsArguments):
self.ali_paths = args.ali_paths
self.new_ali_paths = args.new_ali_paths

def _run(self) -> typing.Generator[typing.Tuple[int, int]]:
def _run(self) -> None:
"""Run the function"""
with self.session() as session, thread_logger(
"kalpy.train", self.log_path, job_name=self.job_name
Expand Down
23 changes: 14 additions & 9 deletions montreal_forced_aligner/alignment/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ def align(self, workflow_name=None) -> None:
"""Run the aligner"""
self.alignment_mode = True
self.initialize_database()
self.create_new_current_workflow(WorkflowType.alignment, workflow_name)
wf = self.current_workflow
if wf is None:
self.create_new_current_workflow(WorkflowType.alignment, workflow_name)
wf = self.current_workflow
if wf.done:
logger.info("Alignment already done, skipping.")
Expand Down Expand Up @@ -383,11 +385,11 @@ def align(self, workflow_name=None) -> None:
assert self.alignment_model_path.suffix == ".mdl"
logger.info("Performing second-pass alignment...")
self.align_utterances()
self.collect_alignments()
if self.use_phone_model:
self.transcribe(WorkflowType.phone_transcription)
elif self.fine_tune:
self.fine_tune_alignments()
self.collect_alignments()
if self.use_phone_model:
self.transcribe(WorkflowType.phone_transcription)
elif self.fine_tune:
self.fine_tune_alignments()

with self.session() as session:
session.query(CorpusWorkflow).filter(CorpusWorkflow.id == wf.id).update(
Expand Down Expand Up @@ -1062,7 +1064,7 @@ def fine_tune_alignments(self) -> None:
Fine tune aligned boundaries to millisecond precision
"""
logger.info("Fine tuning alignments...")
begin = time.time()
all_begin = time.time()
with self.session() as session:
arguments = self.fine_tune_arguments()
update_mappings = []
Expand Down Expand Up @@ -1110,7 +1112,7 @@ def fine_tune_alignments(self) -> None:
)
session.commit()
self.export_frame_shift = round(self.export_frame_shift / 10, 4)
logger.debug(f"Fine tuning alignments took {time.time() - begin:.3f} seconds")
logger.debug(f"Fine tuning alignments took {time.time() - all_begin:.3f} seconds")

def fine_tune_arguments(self) -> List[FineTuneArguments]:
"""
Expand All @@ -1137,6 +1139,9 @@ def fine_tune_arguments(self) -> List[FineTuneArguments]:
options = self.pitch_options
options["frame_shift"] = 1
pitch_computer = PitchComputer(**options)
align_options = self.align_options
# align_options['transition_scale'] = align_options['transition_scale'] / 10
align_options["acoustic_scale"] = 1.0
for j in self.jobs:
log_path = self.working_log_directory.joinpath(f"fine_tune.{j.id}.log")
args.append(
Expand All @@ -1149,7 +1154,7 @@ def fine_tune_arguments(self) -> List[FineTuneArguments]:
lexicon_compiler,
self.model_path,
self.tree_path,
self.align_options,
align_options,
phone_to_group_mapping,
self.mfcc_computer.frame_shift,
)
Expand Down
Loading

0 comments on commit 78e481d

Please sign in to comment.