Teacher Forcing Recovers Reward Functions for Text Generation