Optimisation suggestion:
I think reload_index() could pass the predicted_labels as arguments to __inst_doc_from_id(). --> __inst_doc_from_id() could search them only if they are not given as argument.