MediaPipeTasksText Framework Reference

EmbeddingResult

class EmbeddingResult : NSObject

Represents the embedding results of a model. Typically used as a result for embedding tasks.

  • An Array of MPPEmbedding objects containing the embedding results for each head of the model.

    Declaration

    Swift

    var embeddings: [Embedding] { get }
  • @brief The optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results. This is only used for embedding extraction on time series (e.g. audio embedder). In these use cases, the amount of data to process might exceed the maximum size that the model can process. To solve this, the input data is split into multiple chunks starting at different timestamps.

    Declaration

    Swift

    var timestampInMilliseconds: Int { get }
  • Initializes a new MPPEmbedding with the given array of embeddings and timestamp (in milliseconds).

    Declaration

    Swift

    init(embeddings: [Embedding], timestampInMilliseconds: Int)

    Parameters

    embeddings

    An Array of MPPEmbedding objects containing the embedding results for each head of the model.

    timestampInMilliseconds

    The optional timestamp (in milliseconds) of the start of the chunk of data corresponding to these results. Pass 0 if timestamp is absent.

    Return Value

    An instance of MPPEmbeddingResult initialized with the given array of embeddings and timestamp (in milliseconds).

  • Undocumented

  • Undocumented