docstr: Fetches the sequence lengths of sentence-level features per input example.
  
  This is needed because we treat sentence-level features as token-level features
  with 1 token per input example. Hence, the sequence lengths returned by this
  function are all 1s if sentence-level features are present, and 0s otherwise.
docstr_tok: ["Fetches","the","sequence","lengths","of","sentence-level","features","per","input","example",".","This","is","needed","because","we","treat","sentence-level","features","as","token-level","features","with","1","token","per","input","example",".","Hence",",","the","sequence","lengths","returned","by","this","function","are","all","1s","if","sentence-level","features","are","present",",","and","0s","otherwise","."]
code: def _get_sentence_feature_lengths(
      self,
      tf_batch_data: Dict[Text, Dict[Text, List[tf.Tensor]]],
      key: Text,
  ) -> tf.Tensor:
      """Fetches the sequence lengths of sentence-level features per input example.
  
      This is needed because we treat sentence-level features as token-level features
      with 1 token per input example. Hence, the sequence lengths returned by this
      function are all 1s if sentence-level features are present, and 0s otherwise.
      """
      batch_dim = self._get_batch_dim(tf_batch_data[key])
  
      if key in tf_batch_data and SENTENCE in tf_batch_data[key]:
          return tf.ones([batch_dim], dtype=tf.int32)
  
      return tf.zeros([batch_dim], dtype=tf.int32)
  
imports: import time
  import random
  import tensorflow
  import numpy
  import logging
  import os
  from collections import defaultdict
  from typing import List, Text, Dict, Tuple, Union, Optional, Any, TYPE_CHECKING
  from keras.utils import tf_utils
  from keras import Model
  from rasa.shared.constants import DIAGNOSTIC_DATA
  from rasa.utils.tensorflow.constants import LABEL, IDS, INTENT_CLASSIFICATION, SENTENCE, SEQUENCE_LENGTH, RANDOM_SEED, EMBEDDING_DIMENSION, REGULARIZATION_CONSTANT, SIMILARITY_TYPE, CONNECTION_DENSITY, NUM_NEG, LOSS_TYPE, MAX_POS_SIM, MAX_NEG_SIM, USE_MAX_NEG_SIM, NEGATIVE_MARGIN_SCALE, SCALE_LOSS, LEARNING_RATE, CONSTRAIN_SIMILARITIES, MODEL_CONFIDENCE, RUN_EAGERLY
  from rasa.utils.tensorflow.model_data import RasaModelData, FeatureSignature, FeatureArray
  import rasa.utils.train_utils
  from rasa.utils.tensorflow import layers
  from rasa.utils.tensorflow import rasa_layers
  from rasa.utils.tensorflow.data_generator import RasaDataGenerator, RasaBatchDataGenerator
  from rasa.shared.nlu.constants import TEXT
  from rasa.shared.exceptions import RasaException
  from rasa.utils.tensorflow.types import BatchData, MaybeNestedBatchData
label_desc: Use image node_id 19 for calling the TransformerRasaModel obj's underlying member method code with example usage: obj._get_sentence_feature_lengths(tf_batch_data, key) and returns: tf, tf