docstr: Instantiates a document embedding using the SentenceTransformer Embeddings.
  
  Args:
      model: string name of models from SentencesTransformer Class
      batch_size: int number of sentences to processed in one batch
docstr_tok: ["Instantiates","a","document","embedding","using","the","SentenceTransformer","Embeddings",".","Args",":","model",":","string","name","of","models","from","SentencesTransformer","Class","batch_size",":","int","number","of","sentences","to","processed","in","one","batch"]
code: def __init__(
      self,
      model: str = "bert-base-nli-mean-tokens",
      batch_size: int = 1,
  ) -> None:
      """Instantiates a document embedding using the SentenceTransformer Embeddings.
  
      Args:
          model: string name of models from SentencesTransformer Class
          batch_size: int number of sentences to processed in one batch
      """
      super().__init__()
  
      try:
          from sentence_transformers import SentenceTransformer
      except ModuleNotFoundError:
          log.warning("-" * 100)
          log.warning(
              'ATTENTION! The library "sentence-transformers" is not installed!'
          )
          log.warning(
              'To use Sentence Transformers, please first install with "pip install sentence-transformers"'
          )
          log.warning("-" * 100)
  
      self.model_name = model
      self.model = SentenceTransformer(
          model,
          cache_folder=str(
              flair.cache_root / "embeddings" / "sentence-transformer"
          ),
      )
      self.name = "sentence-transformers-" + str(model)
      self.batch_size = batch_size
      self.static_embeddings = True
      self.eval()
  
imports: import logging
  from typing import Any, Dict, List, Optional, Union, cast
  import torch
  from sklearn.feature_extraction.text import TfidfVectorizer
  from torch.nn import RNNBase
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  import flair
  from flair.data import Sentence
  from flair.embeddings.base import DocumentEmbeddings, load_embeddings, register_embeddings
  from flair.embeddings.token import FlairEmbeddings, StackedEmbeddings, TokenEmbeddings
  from flair.embeddings.transformer import TransformerEmbeddings, TransformerOnnxDocumentEmbeddings
  from flair.nn import LockedDropout, WordDropout
label_desc: Use image node_id 1 to create a new SentenceTransformerDocumentEmbeddings object from inherited base classes: DocumentEmbeddings with example: obj = SentenceTransformerDocumentEmbeddings(model, batch_size)