code: def test_crf_use_dense_features(
      crf_entity_extractor: Callable[
          [Dict[Text, Any]], CRFEntityExtractor
      ],
      spacy_nlp: Any,
      spacy_featurizer: SpacyFeaturizer,
      spacy_tokenizer: SpacyTokenizer,
  ):
      component_config = {
          "features": [
              ["low", "title", "upper", "pos", "pos2"],
              [
                  "low",
                  "suffix3",
                  "suffix2",
                  "upper",
                  "title",
                  "digit",
                  "pos",
                  "pos2",
                  "text_dense_features",
              ],
              ["low", "title", "upper", "pos", "pos2"],
          ]
      }
      crf_extractor = crf_entity_extractor(component_config)
  
      text = "Rasa is a company in Berlin"
      message = Message(data={TEXT: text})
      message.set(SPACY_DOCS[TEXT], spacy_nlp(text))
  
      spacy_tokenizer.process([message])
      spacy_featurizer.process([message])
  
      text_data = crf_extractor._convert_to_crf_tokens(message)
      features = crf_extractor._crf_tokens_to_features(text_data)
  
      assert "0:text_dense_features" in features[0]
      dense_features, _ = message.get_dense_features(TEXT, [])
      if dense_features:
          dense_features = dense_features.features
  
      for i in range(0, len(dense_features[0])):
          assert (
              features[0]["0:text_dense_features"][
                  "text_dense_features"
              ][str(i)]
              == dense_features[0][i]
          )
  
imports: import copy
  from typing import Dict, Text, List, Any, Callable
  import pytest
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFeaturizer
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
  from rasa.nlu.constants import SPACY_DOCS
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.nlu.utils.spacy_utils import SpacyModel, SpacyNLP
  from rasa.shared.importers.rasa import RasaFileImporter
  from rasa.shared.nlu.constants import TEXT, ENTITIES
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.extractors.crf_entity_extractor import CRFEntityExtractor, CRFEntityExtractorOptions
label_desc: Use image node_id 3 for calling a global function with example usage: test_crf_use_dense_features(crf_entity_extractor, spacy_nlp, spacy_featurizer, spacy_tokenizer) without return types