def get_docs_and_scores(self, query, topk=100):
    """Retrieve documents based on BM25 scores.

    Args:
      query: The query to retrieve documents for.
      topk: Return top-k document ids.

    Returns:
      A List of (document title, score) tuples of length `topk`.
    """
    scores = self._compute_scores(query)
    sorted_docs_ids = np.argsort(scores)
    topk_doc_ids = sorted_docs_ids[:topk]
    return [(self.documents[idx].title, scores[idx]) for idx in topk_doc_ids]
Retrieve documents based on BM25 scores.

    Args:
      query: The query to retrieve documents for.
      topk: Return top-k document ids.

    Returns:
      A List of (document title, score) tuples of length `topk`.
    
language/quest/bm25/bm25_retriever.py