Update BOWTrainer to support labeled images.