code: def sequence_accuracy_score(y_true, y_pred):
      """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 seqeval.metrics 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
      """
      if any(isinstance(s, list) for s in y_true):
          y_true = [item for sublist in y_true for item in sublist]
          y_pred = [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, y_pred))
      nb_true = len(y_true)
  
      score = nb_correct / nb_true
  
      return score
  
file_path: nlp-architect/nlp_architect/utils/metrics.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from scipy.stats import pearsonr, spearmanr
  from sklearn.metrics import f1_score
  from collections import defaultdict
  import numpy
label_desc: Use image node_id 11 for calling a global function with example usage: sequence_accuracy_score(y_true, y_pred) and returns: score