0

I'm trying to run the word_align.pl script provided by CMUSphinx. I write the command as follows:

perl word_align.pl actualtext.txt batchOutputText.txt

But the terminal gives me the following errors:

Use of uninitialized value $ref_uttid in hash element at word_align.pl line 60, line 1.
Use of uninitialized value $ref_uttid in concatenation (.) or string at word_align.pl line 61, line 1.
UttID is not ignored but it could not found in any entries of the hypothesis file on line3 1 UTTID

I am not quite familiar with Perl and I can't figure out what is the problem here though I followed the instructions provided by CMUSphinx to run that script

You can find the script here

Edit: here is the reference's file link

A.M.
  • 34
  • 5
  • On a quick look: (1) line enumeration doesn't make sense (l.60 of script is empty, l.61 doesn't seem relevant either. (Did you alter the file when copying it in any way, added comments or such?) (2) tracing the variable reported in the error back through the script I'd venture a guess that something's not right with the first input file. – zdim Mar 21 '16 at 00:55
  • @zdim no I haven't altered the script in any way. As far as I understood both files should be .txt files with the following format: text (file12) where the filenames -those inside the brackets- should be the same in both files – A.M. Mar 21 '16 at 01:02

1 Answers1

1

The answer is in this error message

UttID is not ignored but it could not found in any entries of the hypothesis file on line3 1 UTTID

The reference file that you are passing is malformed, specifically its first line isn't formatted as it should be

More precisely, each line of the reference file requires a UTT ID—a unique string in parentheses like (output00000). It must be unique because it is used as a hash key. A simple digit like (1) won't work as it will be mistaken for an alternative pronunciation

The first line of your file must be different from that. You suggest

<s> text </s> (file12)

which actually works fine—I have tested it—and $ref_uttid comes out as FILE12. If you tell us what is actually in your file then I am sure we could help you better

Borodin
  • 126,100
  • 9
  • 70
  • 144
  • How can I supply you with my file? Note: I tried running the command but with adding -i at the end and it worked fine! Can you explain why is this? – A.M. Mar 21 '16 at 19:01
  • You could edit your question to post a short representative sample of your data there, or you could put your file on [pastebin.com](http://pastebin.com/) and link to it here. I'm about to go to bed so I won't be able to assess anything until the morning – Borodin Mar 21 '16 at 19:45
  • I've added a link to my ref file, it is basically a text script of one of the ted talks. Thank you for your help – A.M. Mar 26 '16 at 12:40