def _relevance_score(pred_log_probs: Dict[str, float]) -> float:
    """
    Compute relevance score.

    Args:
        pred_log_probs (Dict[str, float]): log probabilities of tokens

    Returns:
        float: relevance score

    """
    rel_prob = np.exp(float(pred_log_probs["[Relevant]"]))
    irel_prob = np.exp(float(pred_log_probs["[Irrelevant]"]))
    return rel_prob / (rel_prob + irel_prob)

    Compute relevance score.

    Args:
        pred_log_probs (Dict[str, float]): log probabilities of tokens

    Returns:
        float: relevance score

    
llama-index-packs/llama-index-packs-self-rag/llama_index/packs/self_rag/base.py