Word graphs for confidence estimation and Bayes risk decoding in automatic speech recognition, using forward-backward algorithm