class_docstr: Metrics factory. Returns:
      - metric value
      - should it be maximized or minimized
      - Reduce function
  
  Maximized or minimized is needed for early stopping (saving best checkpoint)
  Reduce function to generate a single metric value, usually "mean" or "none"
class_docstr_tok: ["Metrics","factory",".","Returns",":","-","metric","value","-","should","it","be","maximized","or","minimized","-","Reduce","function","Maximized","or","minimized","is","needed","for","early","stopping","(","saving","best","checkpoint",")","Reduce","function","to","generate","a","single","metric","value",",","usually","``","mean","''","or","``","none","''"]
docstr: Access to Metrics.
  
  Args:
      name: metrics name
  Returns:
      A class to build the Metrics
docstr_tok: ["Access","to","Metrics",".","Args",":","name",":","metrics","name","Returns",":","A","class","to","build","the","Metrics"]
code: def get(cls, name: str) -> Any:
      """Access to Metrics.
  
      Args:
          name: metrics name
      Returns:
          A class to build the Metrics
      """
      return cls._metrics.get(name, cls._metrics["BLEU"])
  
imports: import logging
  import os
  from functools import partial
  from typing import Any, Dict, List, Tuple, Union
  import numpy
  import openai
  import pandas
  import torch
  from joblib import Parallel, delayed
  from numpy.typing import NDArray
  from sacrebleu import BLEU
  from sacrebleu.metrics.base import Metric
  from tenacity import retry, stop_after_attempt, wait_random_exponential
  from torch import nn
  from tqdm import tqdm
  from llm_studio.src.datasets.text_utils import get_texts
  from llm_studio.src.utils.logging_utils import TqdmToLogger
label_desc: Use image node_id 2 for calling the Metrics obj's underlying member method code with example usage: obj.get(cls, name) and returns: cls