code: def test_chunking_fast(self):
      # Note: We cannot run the test on "conflicts" on the chunking.
      # The problem is that the model is random, and thus the results do heavily
      # depend on the chunking, so we cannot expect "abcd" and "bcd" to find
      # the same entities. We defer to slow tests for this.
      pipe = pipeline(
          model="hf-internal-testing/tiny-bert-for-token-classification"
      )
      sentence = "The company, based in New York City was founded in 2016 by French entrepreneurs"
  
      results = pipe(sentence, aggregation_strategy="first")
      # This is what this random model gives on the full sentence
      self.assertEqual(
          nested_simplify(results),
          [
              # This is 2 actual tokens
              {
                  "end": 39,
                  "entity_group": "MISC",
                  "score": 0.115,
                  "start": 31,
                  "word": "city was",
              },
              {
                  "end": 79,
                  "entity_group": "MISC",
                  "score": 0.115,
                  "start": 66,
                  "word": "entrepreneurs",
              },
          ],
      )
  
      # This will force the tokenizer to split after "city was".
      pipe.tokenizer.model_max_length = 12
      self.assertEqual(
          pipe.tokenizer.decode(
              pipe.tokenizer.encode(sentence, truncation=True)
          ),
          "[CLS] the company, based in new york city was [SEP]",
      )
  
      stride = 4
      results = pipe(
          sentence, aggregation_strategy="first", stride=stride
      )
      self.assertEqual(
          nested_simplify(results),
          [
              {
                  "end": 39,
                  "entity_group": "MISC",
                  "score": 0.115,
                  "start": 31,
                  "word": "city was",
              },
              # This is an extra entity found by this random model, but at least both original
              # entities are there
              {
                  "end": 58,
                  "entity_group": "MISC",
                  "score": 0.115,
                  "start": 56,
                  "word": "by",
              },
              {
                  "end": 79,
                  "entity_group": "MISC",
                  "score": 0.115,
                  "start": 66,
                  "word": "entrepreneurs",
              },
          ],
      )
  
imports: import unittest
  import numpy
  from transformers import MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, AutoModelForTokenClassification, AutoTokenizer, TokenClassificationPipeline, pipeline
  from transformers.pipelines import AggregationStrategy, TokenClassificationArgumentHandler
  from transformers.testing_utils import is_pipeline_test, nested_simplify, require_tf, require_torch, require_torch_accelerator, slow, torch_device
  from .test_pipelines_common import ANY
label_desc: Use image node_id 5 for calling the TokenClassificationPipelineTests obj's underlying member method code with example usage: obj.test_chunking_fast() without return types