Added a function to classify doc in batch