Improving character length accuracy in content generation