A Generative Model for Joint Natural Language Understanding and Generation