code: def test_ner_extractor_in_pipeline(
      raw_texts, hf_annotations, batch_size
  ):
      pipeline = Pipeline()
      pipeline.add_component(
          name="ner_extractor",
          instance=NamedEntityExtractor(
              backend=NamedEntityExtractorBackend.HUGGING_FACE,
              model_name_or_path="dslim/bert-base-NER",
          ),
      )
  
      outputs = pipeline.run(
          {
              "ner_extractor": {
                  "documents": [
                      Document(content=text) for text in raw_texts
                  ],
                  "batch_size": batch_size,
              }
          }
      )["ner_extractor"]["documents"]
      predicted = [
          NamedEntityExtractor.get_stored_annotations(doc)
          for doc in outputs
      ]
      _check_predictions(predicted, hf_annotations)
  
file_path: haystack/e2e/pipelines/test_named_entity_extractor.py
imports: import pytest
  from haystack import Document, Pipeline, ComponentError
  from haystack.components.extractors import NamedEntityAnnotation, NamedEntityExtractor, NamedEntityExtractorBackend
label_desc: Use image node_id 7 for calling a global function with example usage: test_ner_extractor_in_pipeline(raw_texts, hf_annotations, batch_size) without return types