Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aligned.mlf not being created by script #16

Open
scharney opened this issue Oct 29, 2023 · 0 comments
Open

aligned.mlf not being created by script #16

scharney opened this issue Oct 29, 2023 · 0 comments

Comments

@scharney
Copy link

scharney commented Oct 29, 2023

Hello! I hope this project is still being maintained, as I'm currently having an issue with the forced alignment in python. I am running this code to try to perform forced alignment on the data file based on the tutorial in the readme:
phoneme_alignments, word_alignments = align.align('filepath/pn_pra_OL7_au.wav', 'test.txt')

However, when I try to run it, I get this error message:

creating plp...
 HCopy -T 1 -C C:\Users\rocco\Documents\1-School_Stuff\ling400\p2fa/model\16000\config -S C:\Users\rocco\AppData\Local\Temp\p2fa\codetr.scp
running viterbi...
 HVite -T 1 -a -m -I C:\Users\rocco\AppData\Local\Temp\p2fa\tmp.mlf -H C:\Users\rocco\Documents\1-School_Stuff\ling400\p2fa/model\16000\macros -H C:\Users\rocco\Documents\1-School_Stuff\ling400\p2fa/model\16000\hmmdefs -S C:\Users\rocco\AppData\Local\Temp\p2fa\test.scp -i C:\Users\rocco\AppData\Local\Temp\p2fa\aligned.mlf -p 0.0 -s 5.0 C:\Users\rocco\AppData\Local\Temp\p2fa\dict C:\Users\rocco\Documents\1-School_Stuff\ling400\p2fa/model\monophones > C:\Users\rocco\AppData\Local\Temp\p2fa\aligned.results
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_38416\805211500.py in <module>
----> 1 phoneme_alignments, word_alignments = align.align('filepath/pn_pra_OL7_au.wav', 'test.txt')

~\Documents\1-School_Stuff\ling400\p2fa\align.py in align(wavfile, trsfile, outfile, wave_start, wave_end, sr_override, model_path, custom_dict, state_align, verbose)
    449         state_alignments = None
    450 
--> 451     _alignments = read_aligned_mlf(output_mlf, sr, float(wave_start))
    452     phoneme_alignments, word_alignments = make_alignment_lists(_alignments)
    453 

~\Documents\1-School_Stuff\ling400\p2fa\align.py in read_aligned_mlf(mlffile, SR, wave_start)
    186     # TODO: extract log-likelihood score
    187 
--> 188     f = open(mlffile, 'r')
    189     lines = [l.rstrip() for l in f.readlines()]
    190     f.close()

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\rocco\\AppData\\Local\\Temp\\p2fa\\aligned.mlf'

This errors out because it cant find the file "aligned.mlf" in the temp folder. I can't create this file myself, since the program clears this folder upon each run. Hopefully, I've done something simple wrong and you can let me know! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant