Skip to content

Commit

Permalink
Update for japanese model (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe committed Oct 12, 2023
1 parent 4730e9b commit 4530f97
Show file tree
Hide file tree
Showing 44 changed files with 3,105 additions and 1,020 deletions.
20 changes: 14 additions & 6 deletions docs/source/changelog/changelog_3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,31 @@
3.0 Changelog
*************

3.0.0a6
=======

- Added support for generating pronunciations during training and alignment via :code:`--g2p_model_path`
- Added support for Japanese tokenization through sudachipy
- Fixed a crash in fine tuning
- Added functionality for allowing a directory to be passed as the output path for :ref:`align_one`

3.0.0a5
=======

- Update for :xref:`kalpy` version 0.5.5
- Update :code:`--single_speaker` mode to not perform speaker adaptation
- Add documentation for :ref:`concept_speaker_adaptation`
- Updated for :xref:`kalpy` version 0.5.5
- Updated :code:`--single_speaker` mode to not perform speaker adaptation
- Added documentation for :ref:`concept_speaker_adaptation`

3.0.0a4
=======

- Separate out segmentation functionality into :ref:`create_segments` and :ref:`create_segments_vad`
- Fix a bug in :ref:`align_one` when specifying a :code:`config_path`
- Separated out segmentation functionality into :ref:`create_segments` and :ref:`create_segments_vad`
- Fixed a bug in :ref:`align_one` when specifying a :code:`config_path`

3.0.0a3
=======

- Refactor tokenization for future spacy use
- Refactored tokenization for future spacy use

3.0.0a2
=======
Expand Down
4 changes: 2 additions & 2 deletions montreal_forced_aligner/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def construct_engine(self, **kwargs) -> sqlalchemy.engine.Engine:
return e

@property
def session(self, **kwargs) -> sqlalchemy.orm.scoped_session:
def session(self) -> sqlalchemy.orm.scoped_session:
"""
Construct database session
Expand All @@ -408,7 +408,7 @@ def session(self, **kwargs) -> sqlalchemy.orm.scoped_session:
"""
if self._session is None:
self._session = scoped_session(
sessionmaker(bind=self.db_engine, expire_on_commit=False, **kwargs)
sessionmaker(bind=self.db_engine, expire_on_commit=False)
)
return self._session

Expand Down
4 changes: 4 additions & 0 deletions montreal_forced_aligner/acoustic_modeling/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ def meta(self) -> MetaDict:
utterance_count, duration, average_log_likelihood = summary.first()
data = {
"phones": sorted(self._generate_non_positional_list(self.non_silence_phones)),
"phone_mapping": {
k: v for k, v in self.phone_mapping.items() if not k.startswith("#")
},
"phone_groups": self.worker.phone_groups,
"version": get_mfa_version(),
"architecture": self.architecture,
Expand All @@ -510,6 +513,7 @@ def meta(self) -> MetaDict:
"clitic_marker": self.worker.clitic_marker,
"position_dependent_phones": self.worker.position_dependent_phones,
},
"language": str(self.worker.language),
"features": self.feature_options,
"oov_phone": self.worker.oov_phone,
"optional_silence_phone": self.worker.optional_silence_phone,
Expand Down
6 changes: 3 additions & 3 deletions montreal_forced_aligner/acoustic_modeling/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ def export_model(self, output_model_path: Path) -> None:
export_directory = os.path.dirname(output_model_path)
if export_directory:
os.makedirs(export_directory, exist_ok=True)
# self.export_trained_rules(
# self.training_configs[self.final_identifier].working_directory
# )
self.export_trained_rules(
self.training_configs[self.final_identifier].working_directory
)
with self.session() as session:
for d in session.query(Dictionary):
base_name = self.dictionary_base_names[d.id]
Expand Down
9 changes: 7 additions & 2 deletions montreal_forced_aligner/acoustic_modeling/triphone.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,17 @@ def _setup_tree(self, init_from_previous=False, initial_mix_up=True) -> None:
if initial_mix_up:
mix_up = self.initial_gaussians
mix_down = self.initial_gaussians
old_transition_model, old_acoustic_model = read_gmm_model(
os.path.join(self.previous_aligner.working_directory, "final.mdl")
)
old_tree = read_tree(os.path.join(self.previous_aligner.working_directory, "tree"))
gmm_init_model_from_previous(
topo,
tree,
tree_stats,
os.path.join(self.previous_aligner.working_directory, "final.mdl"),
os.path.join(self.previous_aligner.working_directory, "tree"),
old_acoustic_model,
old_transition_model,
old_tree,
str(self.model_path),
mixup=mix_up,
mixdown=mix_down,
Expand Down
Loading

0 comments on commit 4530f97

Please sign in to comment.