code: def _chrf_score_compute(
      total_preds_char_n_grams: Dict[int, Tensor],
      total_preds_word_n_grams: Dict[int, Tensor],
      total_target_char_n_grams: Dict[int, Tensor],
      total_target_word_n_grams: Dict[int, Tensor],
      total_matching_char_n_grams: Dict[int, Tensor],
      total_matching_word_n_grams: Dict[int, Tensor],
      n_order: float,
      beta: float,
  ) -> Tensor:
      """Compute chrF/chrF++ score based on pre-computed target, prediction and matching character and word n-grams.
  
      Args:
          total_preds_char_n_grams: number of hypothesis character n-grams.
          total_preds_word_n_grams: number of hypothesis word n-grams.
          total_target_char_n_grams: number of reference character n-grams.
          total_target_word_n_grams: number of reference word n-grams.
          total_matching_char_n_grams: number of matching character n-grams between references and hypotheses.
          total_matching_word_n_grams: number of total matching word n-grams between references and hypotheses.
          n_order: A sum of character and word n-gram order.
          beta:
              A parameter determining an importance of recall w.r.t. precision. If `beta=1`, their importance is equal.
  
      Return:
          A corpus-level chrF/chrF++ score.
  
      """
      return _calculate_fscore(
          total_matching_char_n_grams,
          total_matching_word_n_grams,
          total_preds_char_n_grams,
          total_preds_word_n_grams,
          total_target_char_n_grams,
          total_target_word_n_grams,
          n_order,
          beta,
      )
  
file_path: torchmetrics/src/torchmetrics/functional/text/chrf.py
imports: from collections import defaultdict
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor, tensor
  from torchmetrics.functional.text.helper import _validate_inputs
label_desc: Use image node_id 12 for calling a global function with example usage: _chrf_score_compute(total_preds_char_n_grams, total_preds_word_n_grams, total_target_char_n_grams, total_target_word_n_grams, total_matching_char_n_grams, total_matching_word_n_grams, n_order, beta) and returns: _calculate_fscore