class_docstr: A featurizer that uses transformer-based language models.
  
  This component loads a pre-trained language model
  from the Transformers library (https://github.com/huggingface/transformers)
  including BERT, GPT, GPT-2, xlnet, distilbert, and roberta.
  It also tokenizes and featurizes the featurizable dense attributes of
  each message.
class_docstr_tok: ["A","featurizer","that","uses","transformer-based","language","models",".","This","component","loads","a","pre-trained","language","model","from","the","Transformers","library","(","https",":","\/\/github.com\/huggingface\/transformers",")","including","BERT",",","GPT",",","GPT-2",",","xlnet",",","distilbert",",","and","roberta",".","It","also","tokenizes","and","featurizes","the","featurizable","dense","attributes","of","each","message","."]
docstr: Computes sentence and sequence level representations for relevant tokens.
  
  Args:
      sequence_embeddings: Sequence level dense features received as output from
      language model.
  
  Returns: Sentence and sequence level representations.
docstr_tok: ["Computes","sentence","and","sequence","level","representations","for","relevant","tokens",".","Args",":","sequence_embeddings",":","Sequence","level","dense","features","received","as","output","from","language","model",".","Returns",":","Sentence","and","sequence","level","representations","."]
code: def _post_process_sequence_embeddings(
      self, sequence_embeddings: np.ndarray
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Computes sentence and sequence level representations for relevant tokens.
  
      Args:
          sequence_embeddings: Sequence level dense features received as output from
          language model.
  
      Returns: Sentence and sequence level representations.
      """
      from rasa.nlu.utils.hugging_face.registry import (
          model_embeddings_post_processors,
      )
  
      sentence_embeddings = []
      post_processed_sequence_embeddings = []
  
      for example_embedding in sequence_embeddings:
          (
              example_sentence_embedding,
              example_post_processed_embedding,
          ) = model_embeddings_post_processors[self.model_name](
              example_embedding
          )
  
          sentence_embeddings.append(example_sentence_embedding)
          post_processed_sequence_embeddings.append(
              example_post_processed_embedding
          )
  
      return (
          np.array(sentence_embeddings),
          ragged_array_to_ndarray(post_processed_sequence_embeddings),
      )
  
imports: from __future__ import annotations
  import numpy
  import logging
  from typing import Any, Text, List, Dict, Tuple, Type
  import tensorflow
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.dense_featurizer.dense_featurizer import DenseFeaturizer
  from rasa.nlu.tokenizers.tokenizer import Token, Tokenizer
  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, SEQUENCE_FEATURES, SENTENCE_FEATURES, NO_LENGTH_RESTRICTION, NUMBER_OF_SUB_TOKENS, TOKENS_NAMES
  from rasa.shared.nlu.constants import TEXT, ACTION_TEXT
  from rasa.utils import train_utils
  from rasa.utils.tensorflow.model_data import ragged_array_to_ndarray
label_desc: Use image node_id 12 for calling the LanguageModelFeaturizer obj's underlying member method code with example usage: obj._post_process_sequence_embeddings(sequence_embeddings) and returns: np,  ragged_array_to_ndarray