Generating task-specific training data