class_docstr: Ranking metric.
class_docstr_tok: ["Ranking","metric","."]
docstr: Get model's completion and the relevant logprob from a request state.
docstr_tok: ["Get","model","'s","completion","and","the","relevant","logprob","from","a","request","state","."]
code: def get_model_output_logprob(
      self, result: RequestResult
  ) -> Tuple[str, float]:
      """Get model's completion and the relevant logprob from a request state."""
      model_output, model_logprob = self.MISSING_RESULT_TEXT, 0.0
      if result and result.completions:
          # TODO: Decide how to pick between multiple completions.
          model_output = result.completions[
              0
          ].text  # Model completion, which might contain whitespace
          model_logprob = result.completions[0].logprob
      return model_output, model_logprob
  
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 12 for calling the RankingMetric obj's underlying member method code with example usage: obj.get_model_output_logprob(result) and returns: model_output,  model_logprob