Since the Document Explorer samples documents from a distribution, we use weak supervision at the first and the final hops to account for the otherwise non-differentiabilty in the case of end-to-end training.
we use the document having the shortest TF-IDF distance w.r.t.