code: def test_only_featurizes_text_attribute(
      create_lexical_syntactic_featurizer: Callable[
          [Dict[Text, Any]], LexicalSyntacticFeaturizer
      ]
  ):
      # build a message with tokens for lots of attributes
      sentence = "hello goodbye hello"
      tokens = [
          Token(text=match[0], start=match.start())
          for match in re.finditer(r"\w+", sentence)
      ]
      message_data = {}
      for attribute in (
          MESSAGE_ATTRIBUTES + DENSE_FEATURIZABLE_ATTRIBUTES
      ):
          message_data[attribute] = sentence
          message_data[TOKENS_NAMES[attribute]] = tokens
      message = Message(data=message_data)
  
      # train and process
      featurizer = create_lexical_syntactic_featurizer(
          {"alias": "lsf", "features": [["BOS"]]}
      )
      featurizer.train(TrainingData([message]))
      featurizer.process([message])
      assert len(message.features) == 1
      assert message.features[0].attribute == TEXT
  
imports: import numpy
  import pytest
  import re
  from typing import Text, Dict, Any, Callable, List, Optional, Union
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.nlu.constants import DENSE_FEATURIZABLE_ATTRIBUTES, MESSAGE_ATTRIBUTES, TOKENS_NAMES
  from rasa.nlu.tokenizers.spacy_tokenizer import POS_TAG_KEY
  from rasa.nlu.featurizers.sparse_featurizer.lexical_syntactic_featurizer import LexicalSyntacticFeaturizer, FEATURES
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import FEATURE_TYPE_SEQUENCE, TEXT
  from rasa.shared.exceptions import InvalidConfigException
  from rasa.nlu.tokenizers.tokenizer import Token
label_desc: Use image node_id 5 for calling a global function with example usage: test_only_featurizes_text_attribute(create_lexical_syntactic_featurizer) without return types