Learning to use dialogs