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 aggregate(
      self,
      pre_entities: List[dict],
      aggregation_strategy: AggregationStrategy,
  ) -> List[dict]:
      if aggregation_strategy in {
          AggregationStrategy.NONE,
          AggregationStrategy.SIMPLE,
      }:
          entities = []
          for pre_entity in pre_entities:
              entity_idx = pre_entity["scores"].argmax()
              score = pre_entity["scores"][entity_idx]
              entity = {
                  "entity": self.model.config.id2label[entity_idx],
                  "score": score,
                  "index": pre_entity["index"],
                  "word": pre_entity["word"],
                  "start": pre_entity["start"],
                  "end": pre_entity["end"],
              }
              entities.append(entity)
      else:
          entities = self.aggregate_words(
              pre_entities, aggregation_strategy
          )
  
      if aggregation_strategy == AggregationStrategy.NONE:
          return entities
      return self.group_entities(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 8 for calling the TokenClassificationPipeline obj's underlying member method code with example usage: obj.aggregate(pre_entities, aggregation_strategy) and returns: self, entities