def iter_minibatches(doc_iter, minibatch_size):
 (X_text, y) = get_minibatch(doc_iter, minibatch_size)
 while len(X_text):
  (yield (X_text, y))
  (X_text, y) = get_minibatch(doc_iter, minibatch_size)

def iter_minibatches ( doc_iter , minibatch_size ) : ( X_text , y ) = get_minibatch ( doc_iter , minibatch_size ) while len ( X_text ) : ( yield ( X_text , y ) ) ( X_text , y ) = get_minibatch ( doc_iter , minibatch_size )
generator of minibatches .