port the word-accuracy script