def get_positive_passages(positive_pids, doc_scores, passage_map):
    """
    Get positive passages for a given grounding using BM25 scores from the positive passage pool
    Parameters:
        positive_pids: list
            Positive passage indices
        doc_scores: list
            BM25 scores against the query's grounding for all passages
        passage_map: dict
            All passages mapped with their ids
    Returns:
        positive_passage_pool
    """
    scores = [(i, score) for (i, score) in doc_scores if i in positive_pids]
    top_scores = sorted(scores, key=lambda x: x[1], reverse=True)

    top_n_passages = [
        {"psg_id": ix, "score": score, "title": passage_map[ix]["title"], "text": passage_map[ix]["text"]}
        for ix, score in top_scores
    ]

    return top_n_passages