code: def make_bert_embeddings(
      train_data,
      model,
      device,
      LANGUAGE=Language.ENGLISH,
      TO_LOWER=True,
      BERT_CACHE_DIR="./temp",
      MAX_LEN=150,
  ):
      """Get the bert embedding for multiple sentences
      :param train_data: A list of sentences
      :type df: list
      :param device: A pytorch device
      :type device: torch.device
      :param model: a pytorch model
      :type model: torch.nn
      :param LANGUAGE: The pretrained model's language. Defaults to Language.ENGLISH
      :type LANGUAUGE: str
      :param BERT_CACHE_DIR: Location of BERT's cache directory. Defaults to "'/temp".
      :type BERT_CACHE_DIR: str
      :return: A bert embedding of all the sentences
      :rtype: torch.embedding
      """
      tokenizer = Tokenizer(
          LANGUAGE, to_lower=TO_LOWER, cache_dir=BERT_CACHE_DIR
      )
      tokens = tokenizer.tokenize(train_data)
      tokens, mask, _ = tokenizer.preprocess_classification_tokens(
          tokens, MAX_LEN
      )
      tokens_tensor = torch.tensor(tokens, device=device)
      mask_tensor = torch.tensor(mask, device=device)
      embeddings = model.bert.embeddings(tokens_tensor, mask_tensor)
      return embeddings
  
imports: import logging
  import torch
  from pytorch_pretrained_bert import BertTokenizer
  from interpret_text.experimental.common.utils_bert import Language, Tokenizer
  from interpret_text.experimental.common.constants import BertTokens
label_desc: Use image node_id 2 for calling a global function with example usage: make_bert_embeddings(train_data, model, device, LANGUAGE, TO_LOWER, BERT_CACHE_DIR, MAX_LEN) and returns: embeddings