code: def recall_score(
      y_true: List[List[str]],
      y_pred: List[List[str]],
      suffix: bool = False,
  ) -> float:
      """Compute the recall.
      The recall is the ratio ``tp / (tp + fn)`` where ``tp`` is the number of
      true positives and ``fn`` the number of false negatives. The recall is
      intuitively the ability of the classifier to find all the positive samples.
      The best value is 1 and the worst value is 0.
      Args:
          y_true : 2d array. Ground truth (correct) target values.
          y_pred : 2d array. Estimated targets as returned by a tagger.
      Returns:
          score : float.
      Example:
          >>> from kashgari.metrics.sequence_labeling import recall_score
          >>> y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]
          >>> y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]
          >>> recall_score(y_true, y_pred)
          0.50
      """
      true_entities = set(bulk_get_entities(y_true, suffix=suffix))
      pred_entities = set(bulk_get_entities(y_pred, suffix=suffix))
  
      nb_correct = len(true_entities & pred_entities)
      nb_true = len(true_entities)
  
      score = nb_correct / nb_true if nb_true > 0 else 0
  
      return score
  
file_path: Kashgari/kashgari/metrics/sequence_labeling.py
imports: from collections import defaultdict
  from typing import List, Dict, Tuple, Any
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: recall_score(y_true, y_pred, suffix) and returns: score