Improved batch processing for get vocab ids