class_docstr: Featurizer using ConveRT model.
  
  Loads the ConveRT(https://github.com/PolyAI-LDN/polyai-models#convert)
  model from TFHub and computes sentence and sequence level feature representations
  for dense featurizable attributes of each message object.
class_docstr_tok: ["Featurizer","using","ConveRT","model",".","Loads","the","ConveRT","(","https",":","\/\/github.com\/PolyAI-LDN\/polyai-models","#","convert",")","model","from","TFHub","and","computes","sentence","and","sequence","level","feature","representations","for","dense","featurizable","attributes","of","each","message","object","."]
code: def _compute_sequence_encodings(
      self, batch_examples: List[Message], attribute: Text = TEXT
  ) -> Tuple[np.ndarray, List[int]]:
      list_of_tokens = [
          self.tokenize(example, attribute)
          for example in batch_examples
      ]
  
      number_of_tokens_in_sentence = [
          len(sent_tokens) for sent_tokens in list_of_tokens
      ]
  
      # join the tokens to get a clean text to ensure the sequence length of
      # the returned embeddings from ConveRT matches the length of the tokens
      # (including sub-tokens)
      tokenized_texts = self._tokens_to_text(list_of_tokens)
      token_features = self._sequence_encoding_of_text(tokenized_texts)
  
      # ConveRT might split up tokens into sub-tokens
      # take the mean of the sub-token vectors and use that as the token vector
      token_features = train_utils.align_token_features(
          list_of_tokens, token_features
      )
  
      return token_features, number_of_tokens_in_sentence
  
imports: from __future__ import annotations
  import logging
  import os
  from typing import Any, Dict, List, Optional, Text, Tuple, Type
  import tensorflow
  from tensorflow.python.eager.wrap_function import WrappedFunction
  from tqdm import tqdm
  import numpy
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  import rasa.shared.utils.io
  import rasa.core.utils
  from rasa.nlu.tokenizers.tokenizer import Token, Tokenizer
  from rasa.nlu.featurizers.dense_featurizer.dense_featurizer import DenseFeaturizer
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.constants import DENSE_FEATURIZABLE_ATTRIBUTES, TOKENS_NAMES, NUMBER_OF_SUB_TOKENS
  from rasa.shared.nlu.constants import TEXT, ACTION_TEXT
  from rasa.exceptions import RasaException
  import rasa.nlu.utils
  import rasa.utils.train_utils
label_desc: Use image node_id 13 for calling the ConveRTFeaturizer obj's underlying member method code with example usage: obj._compute_sequence_encodings(batch_examples, attribute) and returns: token_features,  number_of_tokens_in_sentence