backport to Drupal 6
implement batch api for model learning