Browse Source

to transfer working environment to McRoberts laptop.

master
yemaozi88 3 years ago
parent
commit
24ac56ac0e
  1. BIN
      .vs/acoustic_model/v15/.suo
  2. 1
      acoustic_model.sln
  3. BIN
      acoustic_model/__pycache__/defaultfiles.cpython-36.pyc
  4. 3
      acoustic_model/acoustic_model.pyproj
  5. 0
      acoustic_model/acoustic_model_function.py
  6. 6
      acoustic_model/defaultfiles.py
  7. 34
      acoustic_model/forced_aligner_comparison.py
  8. 0
      acoustic_model/train_hmm_fame.py
  9. 3
      reus-test/reus1008-reus.dic
  10. 1
      reus-test/reus1008-reus.lab
  11. 6
      reus-test/reus1008-reus.txt
  12. 3
      reus-test/reus1167-man.dic
  13. 1
      reus-test/reus1167-man.lab
  14. 10
      reus-test/reus1167-man.txt
  15. 3
      reus-test/reus3768-mantsje.dic
  16. 1
      reus-test/reus3768-mantsje.lab
  17. 10
      reus-test/reus3768-mantsje.txt

BIN
.vs/acoustic_model/v15/.suo

1
acoustic_model.sln

@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\forced_alignment\forced_alignment\pronunciations.py = ..\forced_alignment\forced_alignment\pronunciations.py
..\toolbox\pyHTK.py = ..\toolbox\pyHTK.py
..\forced_alignment\forced_alignment\pyhtk.py = ..\forced_alignment\forced_alignment\pyhtk.py
reus-test\reus-test.py = reus-test\reus-test.py
..\forced_alignment\forced_alignment\scripts.py = ..\forced_alignment\forced_alignment\scripts.py
..\..\..\..\..\Python36-32\Lib\site-packages\novoapi\backend\session.py = ..\..\..\..\..\Python36-32\Lib\site-packages\novoapi\backend\session.py
..\forced_alignment\forced_alignment\tempfilename.py = ..\forced_alignment\forced_alignment\tempfilename.py

BIN
acoustic_model/__pycache__/defaultfiles.cpython-36.pyc

3
acoustic_model/acoustic_model.pyproj

@ -4,8 +4,7 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>4d8c8573-32f0-4a62-9e62-3ce5cc680390</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>
</StartupFile>
<StartupFile>forced_aligner_comparison.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>

0
acoustic_model/acoustic_model_functions.py → acoustic_model/acoustic_model_function.py

6
acoustic_model/defaultfiles.py

@ -31,6 +31,12 @@ ipa_xsampa_converter_dir = os.path.join(repo_dir, 'ipa-xsama-converter')
forced_alignment_module_dir = os.path.join(repo_dir, 'forced_alignment')
accent_classification_dir = os.path.join(repo_dir, 'accent_classification', 'accent_classification')
htk_config_dir = r'c:\Users\Aki\source\repos\forced_alignment\forced_alignment\data\htk\preset_models\aki_dutch_2017'
config_hvite = os.path.join(htk_config_dir, 'config.HVite')
#acoustic_model = os.path.join(htk_config_dir, 'hmmdefs.compo')
acoustic_model = r'c:\cygwin64\home\Aki\acoustic_model\model\barbara\hmm128-2\hmmdefs.compo'
phonelist_txt = os.path.join(htk_config_dir, 'phonelist.txt')
WSL_dir = r'C:\OneDrive\WSL'
fame_dir = os.path.join(WSL_dir, 'kaldi-trunk', 'egs', 'fame')
fame_s5_dir = os.path.join(fame_dir, 's5')

34
acoustic_model/forced_aligner_comparison.py

@ -1,10 +1,42 @@
import os
os.chdir(r'C:\Users\Aki\source\repos\acoustic_model\acoustic_model')
import sys
import defaultfiles as default
sys.path.append(default.forced_alignment_module_dir)
from forced_alignment import pyhtk, convert_phone_set, scripts
wav_dir = r'c:\Users\Aki\source\repos\acoustic_model\reus-test'
reus_dir = r'c:\Users\Aki\source\repos\acoustic_model\reus-test'
wav_dir = reus_dir
wav_files = ['reus1008-reus.wav',
'reus1167-man.wav',
'reus3768-mantsje.wav']
word = 'reus'
pronunciation_ipa = ['rø:s', 'mɑn', 'mɑntsjə']
for wav_file in wav_files:
file_lab = os.path.join(reus_dir, wav_file.replace('.wav', '.lab'))
file_dic = os.path.join(reus_dir, wav_file.replace('.wav', '.dic'))
file_txt = os.path.join(reus_dir, wav_file.replace('.wav', '.txt'))
# output htk dict file
with open(file_dic, 'w', encoding="utf-8") as f:
for ipa in pronunciation_ipa:
cgn = convert_phone_set.ipa2cgn([ipa.replace(':', 'ː')])
barbara = convert_phone_set.cgn2barbara(cgn)
f.write(word.upper() + '\t' + barbara + '\n')
# output htk label file.
pyhtk._create_label_file(word, file_lab)
scripts.run_command([
'HVite','-T', '1',
'-a',
'-C', default.config_hvite,
'-H', default.acoustic_model,
'-m',
'-i', file_txt,
#'-S', script_file,
file_dic, default.phonelist_txt, os.path.join(wav_dir, wav_file)
])

0
acoustic_model/acoustic_model.py → acoustic_model/train_hmm_fame.py

3
reus-test/reus1008-reus.dic

@ -0,0 +1,3 @@
REUS r eu s
REUS m ac n
REUS m ac n t s j @

1
reus-test/reus1008-reus.lab

@ -0,0 +1 @@
REUS

6
reus-test/reus1008-reus.txt

@ -0,0 +1,6 @@
#!MLF!#
"c:/Users/Aki/source/repos/acoustic_model/reus-test/reus1008-reus.rec"
0 9700000 r -12463.852539 REUS
9700000 12800000 eu -3622.108887
12800000 26250001 s -17303.216797
.

3
reus-test/reus1167-man.dic

@ -0,0 +1,3 @@
REUS r eu s
REUS m ac n
REUS m ac n t s j @

1
reus-test/reus1167-man.lab

@ -0,0 +1 @@
REUS

10
reus-test/reus1167-man.txt

@ -0,0 +1,10 @@
#!MLF!#
"c:/Users/Aki/source/repos/acoustic_model/reus-test/reus1167-man.rec"
0 150000 m -230.057571 REUS
150000 300000 ac -250.994858
300000 450000 n -202.377716
450000 4600000 t -5128.984375
4600000 5050000 s -711.338501
5050000 5450000 j -564.730591
5450000 16049999 @ -13249.787109
.

3
reus-test/reus3768-mantsje.dic

@ -0,0 +1,3 @@
REUS r eu s
REUS m ac n
REUS m ac n t s j @

1
reus-test/reus3768-mantsje.lab

@ -0,0 +1 @@
REUS

10
reus-test/reus3768-mantsje.txt

@ -0,0 +1,10 @@
#!MLF!#
"c:/Users/Aki/source/repos/acoustic_model/reus-test/reus3768-mantsje.rec"
0 150000 m -217.347229 REUS
150000 1150000 ac -1266.293579
1150000 1650000 n -583.382568
1650000 11100000 t -11259.270508
11100000 11250000 s -247.939255
11250000 11550000 j -445.511444
11550000 24150000 @ -16769.048828
.
Loading…
Cancel
Save