Document capture with advanced machine learning