How to get the confidence level of the words during prediction?

I followed this comment, but not able to find get_beam_search_result function, also how to use them to print it during prediction time.

This is old, have you checked out the Metadata API?
NB: it’s available in all bindings, not just C API.