code: def get_sent_embeddings(
      sent: Sentence,
      idf_model: Dict[str, Union[float, np.float64]],
      min_idf: Union[float, np.float64],
      max_idf: Union[float, np.float64],
      dimensions: int = 300,
  ) -> np.ndarray:
      """Provides the weighted average of a sentence's word vectors.
  
      Expectations:
      Word can only appear once in a sentence, multiple occurrences are collapsed.
      Must have 2 or more embeddings, otherwise Principle Component cannot be found and removed.
  
      :param sent: ``Sentence``
      :param idf_model: a dictionary of tokens and idf values
      :param min_idf: the min idf score to use for scaling
      :param max_idf: the max idf score to use for scaling
      :param dimensions: the number of dimensions of the embedding
  
      :return ndarray: values of the sentence embedding, or returns an array of zeroes if no sentence embedding could be computed.
      """
      map_word_embedding: Dict[str, Tuple[np.float64, np.ndarray]] = {
          token.string: (
              rescale_idf(
                  idf_model.get(token.string.lower(), min_idf),
                  min_idf,
                  max_idf,
              ),
              token.embedding,
          )
          for token in sent.words
          if not np.all(
              (token.embedding == 0)
          )  # skip processing empty embeddings
      }
      weight_embedding_tuple: ValuesView = map_word_embedding.values()
      # We can't create a sentence embedding for just one word
      if len(weight_embedding_tuple) < 2:
          return np.zeros(dimensions)
      weights, embeddings = zip(*weight_embedding_tuple)
      if sum(weights) == 0:
          return np.zeros(dimensions)
      scale_factor: np.float64 = 1 / sum(weights)
      scaled_weights: List[np.float64] = [
          weight * scale_factor for weight in weights
      ]
      scaled_values: np.ndarray = np.array(scaled_weights)
      # Apply our weighted terms to the adjusted embeddings
      weighted_embeds: np.ndarray = embeddings * scaled_values[:, None]
      return np.sum(weighted_embeds, axis=0)
  
file_path: cltk/src/cltk/embeddings/sentence.py
imports: from typing import Dict, List, Tuple, Union, ValuesView
  import numpy
  from sklearn.decomposition import TruncatedSVD
  from cltk.core import Sentence
label_desc: Use image node_id 4 for calling a global function with example usage: get_sent_embeddings(sent, idf_model, min_idf, max_idf, dimensions) and returns: np, np, np