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 _sanitize_parameters(
      self,
      ignore_labels=None,
      grouped_entities: Optional[bool] = None,
      ignore_subwords: Optional[bool] = None,
      aggregation_strategy: Optional[AggregationStrategy] = None,
      offset_mapping: Optional[List[Tuple[int, int]]] = None,
  ):
      preprocess_params = {}
      if offset_mapping is not None:
          preprocess_params["offset_mapping"] = offset_mapping
  
      postprocess_params = {}
      if grouped_entities is not None or ignore_subwords is not None:
          if grouped_entities and ignore_subwords:
              aggregation_strategy = AggregationStrategy.FIRST
          elif grouped_entities and not ignore_subwords:
              aggregation_strategy = AggregationStrategy.SIMPLE
          else:
              aggregation_strategy = AggregationStrategy.NONE
  
          if grouped_entities is not None:
              warnings.warn(
                  "`grouped_entities` is deprecated and will be removed in version v5.0.0, defaulted to"
                  f' `aggregation_strategy="{aggregation_strategy}"` instead.'
              )
          if ignore_subwords is not None:
              warnings.warn(
                  "`ignore_subwords` is deprecated and will be removed in version v5.0.0, defaulted to"
                  f' `aggregation_strategy="{aggregation_strategy}"` instead.'
              )
  
      if aggregation_strategy is not None:
          if isinstance(aggregation_strategy, str):
              aggregation_strategy = AggregationStrategy[
                  aggregation_strategy.upper()
              ]
          if (
              aggregation_strategy
              in {
                  AggregationStrategy.FIRST,
                  AggregationStrategy.MAX,
                  AggregationStrategy.AVERAGE,
              }
              and not self.tokenizer.is_fast
          ):
              raise ValueError(
                  "Slow tokenizers cannot handle subwords. Please set the `aggregation_strategy` option"
                  'to `"simple"` or use a fast tokenizer.'
              )
          postprocess_params[
              "aggregation_strategy"
          ] = aggregation_strategy
      if ignore_labels is not None:
          postprocess_params["ignore_labels"] = ignore_labels
      return preprocess_params, {}, postprocess_params
  
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 2 for calling the TokenClassificationPipeline obj's underlying member method code with example usage: obj._sanitize_parameters(ignore_labels, grouped_entities, ignore_subwords, aggregation_strategy, offset_mapping) and returns: preprocess_params,  dict,  postprocess_params