code: def extract_bert_embeddings(
      self, inputs, max_phrase_len, begin_paddings, device
  ):
      bert_embeddings = extract_bert_embeddings(
          self.config.bert_model,
          self.bert_tokenizer,
          self.bert_model,
          inputs,
          device,
          keep_endpoints=False,
      )
      bert_inputs = torch.zeros(
          (len(inputs), max_phrase_len, bert_embeddings[0].shape[-1]),
          device=device,
      )
      for idx, rep in enumerate(bert_embeddings):
          start = begin_paddings[idx]
          end = start + rep.shape[0]
          bert_inputs[idx, start:end, :] = rep
      return bert_inputs
  
imports: import logging
  import math
  import os
  import random
  import re
  from types import SimpleNamespace
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import stanza.models.classifiers.data
  from stanza.models.classifiers.base_classifier import BaseClassifier
  from stanza.models.classifiers.data import SentimentDatum
  from stanza.models.classifiers.utils import ExtraVectors, ModelType, build_output_layers
  from stanza.models.common.bert_embedding import extract_bert_embeddings
  from stanza.models.common.data import get_long_tensor, sort_all
  from stanza.models.common.foundation_cache import load_bert
  from stanza.models.common.vocab import PAD_ID, UNK_ID
label_desc: Use image node_id 7 for calling the CNNClassifier obj's underlying member method code with example usage: obj.extract_bert_embeddings(inputs, max_phrase_len, begin_paddings, device) and returns: bert_inputs