class_docstr: Label Encoder for the named entity recognition task.
class_docstr_tok: ["Label","Encoder","for","the","named","entity","recognition","task","."]
docstr: Transform raw JSON annotations to word level annotations which can be used
  as references of seqeval evaluation.
  For more information: https://huggingface.co/spaces/evaluate-metric/seqeval
  
  Parameters
  ----------
  y
      The raw json annotations.
  x
      The raw text data
  tokenizer
      The tokenizer to be used for text tokenization.
  
  Returns
  -------
  transformed_y
      A list of word level annotations.
docstr_tok: ["Transform","raw","JSON","annotations","to","word","level","annotations","which","can","be","used","as","references","of","seqeval","evaluation",".","For","more","information",":","https",":","\/\/huggingface.co\/spaces\/evaluate-metric\/seqeval","Parameters","--","--","--","--","--","y","The","raw","json","annotations",".","x","The","raw","text","data","tokenizer","The","tokenizer","to","be","used","for","text","tokenization",".","Returns","--","--","--","-","transformed_y","A","list","of","word","level","annotations","."]
code: def transform_label_for_metric(
      self, y: pd.Series, x: pd.Series, tokenizer
  ):
      """
      Transform raw JSON annotations to word level annotations which can be used
      as references of seqeval evaluation.
      For more information: https://huggingface.co/spaces/evaluate-metric/seqeval
  
      Parameters
      ----------
      y
          The raw json annotations.
      x
          The raw text data
      tokenizer
          The tokenizer to be used for text tokenization.
  
      Returns
      -------
      transformed_y
          A list of word level annotations.
      """
      from .utils import process_ner_annotations
  
      all_annotations, _ = self.extract_ner_annotations(y)
      transformed_y = []
      for annotation, text_snippet in zip(all_annotations, x.items()):
          word_label, _, _, _ = process_ner_annotations(
              annotation,
              text_snippet[-1],
              self.entity_map,
              tokenizer,
              is_eval=True,
          )
          word_label_invers = []
          for l in word_label:
              entity_group = self.inverse_entity_map[l]
              word_label_invers.append(entity_group)
          transformed_y.append(word_label_invers)
      return transformed_y
  
imports: import json
  import logging
  import re
  from typing import Any, Dict, List, Optional, Union
  import jsonschema
  import numpy
  import pandas
  from omegaconf import DictConfig, OmegaConf
  from sklearn.preprocessing import LabelEncoder
  from ..constants import AUTOMM, END_OFFSET, ENTITY_GROUP, NER_ANNOTATION, PROBABILITY, START_OFFSET
label_desc: Use image node_id 5 for calling the NerLabelEncoder obj's underlying member method code with example usage: obj.transform_label_for_metric(y, x, tokenizer) and returns: transformed_y