class_docstr: Ranking metric.
class_docstr_tok: ["Ranking","metric","."]
docstr: Populate the model_relevance field for the ranking objects.
docstr_tok: ["Populate","the","model_relevance","field","for","the","ranking","objects","."]
code: def compute_model_relevance_binary_ranking(
      self, ranking_objects: List[RankingObject]
  ) -> List[RankingObject]:
      """Populate the model_relevance field for the ranking objects."""
      # Sort the ranking objects
      ranking_objects_sorted = sorted(
          ranking_objects,
          key=self.object_to_score_binary_ranking,
          reverse=True,
      )
  
      # Add model relevance
      for ind, ranking_object in enumerate(ranking_objects_sorted):
          ranking_object.model_relevance = (
              len(ranking_objects_sorted) - ind
          )
  
      return ranking_objects_sorted
  
imports: from dataclasses import dataclass
  from typing import Callable, Dict, List, Tuple, Optional
  import pytrec_eval
  from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_RANKING_BINARY
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.adaptation.adapter_spec import AdapterSpec
  from helm.benchmark.scenarios.scenario import unpack_tag, CORRECT_TAG, Reference
  from helm.common.request import RequestResult
  from helm.common.general import binarize_dict
  from .metric import Metric
  from .metric_name import MetricName
  from .metric_service import MetricService
  from .statistic import Stat
label_desc: Use image node_id 11 for calling the RankingMetric obj's underlying member method code with example usage: obj.compute_model_relevance_binary_ranking(ranking_objects) and returns: ranking_objects_sorted