class_docstr: Converts text to embeddings using the RETSim text embedding model.
  
  The RETSim model embeds texts into 256-dimensional float vectors. The embeddings
  are trained using TensorFlow Similarity to be robust against adversarial attacks.
  The model is able to handle inputs of arbitrary length.
docstr: Compute embeddings for a batch of text inputs.
  
  Args:
      inputs: Input texts to embed.
  
  Returns:
      Text embeddings for each text in `inputs`.
code: def embed(
      self,
      inputs: Sequence[str],
  ) -> BatchEmbeddings:
      """Compute embeddings for a batch of text inputs.
  
      Args:
          inputs: Input texts to embed.
  
      Returns:
          Text embeddings for each text in `inputs`.
      """
      batch, docids = binarizer(
          inputs, chunk_size=self._chunk_size
      )  # noqa
      partial_embeddings = self.predict(batch)
      partial_embeddings = np.asanyarray(partial_embeddings)
  
      # average partial embeddings together into global embeddings
      global_embeddings = []
      for idxs in docids:
          embs = np.take(partial_embeddings, idxs, axis=0)
  
          # averaging partial embeddings together, if needed
          if len(embs) > 1:
              avg_emb = np.sum(embs, axis=0) / len(embs)
              avg_emb = avg_emb / np.linalg.norm(avg_emb)
          else:
              avg_emb = embs[0]  # (1, 256) shape
  
          global_embeddings.append(avg_emb)
  
      return global_embeddings
  
file_path: unisim/unisim/embedder/text/text_embedder.py
imports: from typing import Sequence
  import numpy
  from ...types import BatchEmbeddings
  from ..embedder import Embedder
  from .binarizer import binarizer
label_desc: Use image node_id 3 for calling the TextEmbedder obj's underlying member method code with example usage: obj.embed(inputs) and returns: global_embeddings