code: def accuracy_score(
      y_true: List[List[str]], y_pred: List[List[str]]
  ) -> float:
      """Accuracy classification score.
      In multilabel classification, this function computes subset accuracy:
      the set of labels predicted for a sample must *exactly* match the
      corresponding set of labels in y_true.
      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 accuracy_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']]
          >>> accuracy_score(y_true, y_pred)
          0.80
      """
      y_true_all = [item for sublist in y_true for item in sublist]
      y_pred_all = [item for sublist in y_pred for item in sublist]
  
      nb_correct = sum(
          y_t == y_p for y_t, y_p in zip(y_true_all, y_pred_all)
      )
      nb_true = len(y_true)
  
      score = nb_correct / nb_true
  
      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 6 for calling a global function with example usage: accuracy_score(y_true, y_pred) and returns: score