acoustic_model/acoustic_model/pyKaldi.py

26 lines
936 B
Python
Raw Normal View History

2018-08-20 22:50:53 +02:00
import os
import sys
forced_alignment_module = r'C:\Users\Aki\source\repos\forced_alignment'
## ======================= add paths =======================
sys.path.append(forced_alignment_module)
from forced_alignment import convert_phone_set
htk_dict_file = r'C:\OneDrive\Research\rug\experiments\stimmen\dic_top3\Reus.dic'
#kaldi_lexicon = r'C:\OneDrive\WSL\kaldi-trunk\egs\fame\s5\data\lang\phones\'
alignment_txt = r'C:\OneDrive\WSL\kaldi-trunk\egs\fame\s5\exp\tri1_alignme\merged_alignment.txt'
phones_txt = r'C:\OneDrive\WSL\kaldi-trunk\egs\fame\s5\exp\tri1_alignme\phones.txt'
phone_map_txt = r'C:\OneDrive\WSL\kaldi-trunk\egs\fame\s5\data\local\lang\phone_map.txt'
with open(phone_map_txt, 'r', encoding="utf-8") as f:
lines = f.read()
lines = lines.split('\n')
with open(alignment_txt, 'r', encoding="utf-8") as f:
lines =
#phone_in = [line for line in lines if 'SIL' in line]
#if len(phone_in) == 1: