NLP: Getting the top 5 or top 10 predictions I am working on a social networking application and I have to make its news feed better. For example: If someone searches for 'suggest me some good books',  it should yield some names. 

Now, I have used the Infersent algo (to begin with) in order for my model to be able to answer questions. 

I am getting only the best output that my model could predict viz., 'Alchemist'.

I want at least 4 or 5 other outputs, other words, the top five predictions.

I know that Xgboost has the ability to do this activity in some sorts, but I am not sure how I should use that in my problem.

Any heads up?

My apologies, I cannot share any code but I would really appreciate ideas and suggestions.

Thank you,
There's predict_proba method in xgboost. You get probabilites for each class, sort them and take top 5.