what does this doc2vec based ML predict?
The code is trying to predict sentiment of documents (Amazon reviews or yelp reviews).

Kneighbors classifier works with vectors for input. A pre-trained doc2vec model is used to convert each review to a vector.
The classifier is trained to predict sentiment label from vector representing each review.

Accuracy is mean accuracy on the dataset: percentage of reviews which were correctly classified (as positive or negative).