class_docstr: Named Entity Recognition pipeline using any `ModelForTokenClassification`. See the [named entity recognition
  examples](../task_summary#named-entity-recognition) for more information.
  
  This token recognition pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"ner"` (for predicting the classes of tokens in a sequence: person, organisation, location or miscellaneous).
  
  The models that this pipeline can use are models that have been fine-tuned on a token classification task. See the
  up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=token-classification).
class_docstr_tok: ["Named","Entity","Recognition","pipeline","using","any","`","ModelForTokenClassification","`",".","See","the","[","named","entity","recognition","examples","]","(","..","\/task_summary","#","named-entity-recognition",")","for","more","information",".","This","token","recognition","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","ner","''","`","(","for","predicting","the","classes","of","tokens","in","a","sequence",":","person",",","organisation",",","location","or","miscellaneous",")",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","token","classification","task",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=token-classification",")","."]
code: def postprocess(
      self,
      model_outputs,
      aggregation_strategy=AggregationStrategy.NONE,
      ignore_labels=None,
  ):
      if ignore_labels is None:
          ignore_labels = ["O"]
      logits = model_outputs["logits"][0].numpy()
      sentence = model_outputs["sentence"]
      input_ids = model_outputs["input_ids"][0]
      offset_mapping = (
          model_outputs["offset_mapping"][0]
          if model_outputs["offset_mapping"] is not None
          else None
      )
      special_tokens_mask = model_outputs["special_tokens_mask"][
          0
      ].numpy()
  
      maxes = np.max(logits, axis=-1, keepdims=True)
      shifted_exp = np.exp(logits - maxes)
      scores = shifted_exp / shifted_exp.sum(axis=-1, keepdims=True)
  
      pre_entities = self.gather_pre_entities(
          sentence,
          input_ids,
          scores,
          offset_mapping,
          special_tokens_mask,
          aggregation_strategy,
      )
      grouped_entities = self.aggregate(
          pre_entities, aggregation_strategy
      )
      # Filter anything that is in self.ignore_labels
      entities = [
          entity
          for entity in grouped_entities
          if entity.get("entity", None) not in ignore_labels
          and entity.get("entity_group", None) not in ignore_labels
      ]
      return entities
  
imports: import types
  import warnings
  from typing import List, Optional, Tuple, Union
  import numpy
  from ..models.bert.tokenization_bert import BasicTokenizer
  from ..utils import ExplicitEnum, add_end_docstrings, is_tf_available, is_torch_available
  from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Dataset, Pipeline
label_desc: Use image node_id 6 for calling the TokenClassificationPipeline obj's underlying member method code with example usage: obj.postprocess(model_outputs, aggregation_strategy, ignore_labels) and returns: entities