MediaPipeTasksText Framework Reference

Classes

The following classes are available globally.

  • Holds the base options that is used for creation of any type of task. It has fields with important information acceleration configuration, TFLite model source etc.

    Declaration

    Objective-C

    
    @interface MPPBaseOptions : NSObject <NSCopying>
  • Category is a util class that contains a label, its display name, a float value as score, and the index of the label in the corresponding label file. Typically it’s used as the result of classification tasks.

    Declaration

    Objective-C

    
    @interface MPPCategory : NSObject
  • Represents the list of classification for a given classifier head. Typically used as a result for classification tasks.

    Declaration

    Objective-C

    
    @interface MPPClassifications : NSObject
  • Represents the classification results of a model. Typically used as a result for classification tasks.

    Declaration

    Objective-C

    
    @interface MPPClassificationResult : NSObject
  • Represents the embedding for a given embedder head. Typically used in embedding tasks.

    One and only one of the two ‘floatEmbedding’ and ‘quantizedEmbedding’ will contain data, based on whether or not the embedder was configured to perform scala quantization.

    Declaration

    Objective-C

    
    @interface MPPEmbedding : NSObject
  • Represents the embedding results of a model. Typically used as a result for embedding tasks.

    Declaration

    Objective-C

    
    @interface MPPEmbeddingResult : NSObject
  • @brief Predicts the language of an input text.

    This API expects a TFLite model with TFLite Model Metadatathat contains the mandatory (described below) input tensor, output tensor, and the language codes in an AssociatedFile.

    Metadata is required for models with int32 input tensors because it contains the input process unit for the model’s Tokenizer. No metadata is required for models with string input tensors.

    Input tensor

    • One input tensor (kTfLiteString) of shape [1] containing the input string.

    Output tensor

    • One output tensor (kTfLiteFloat32) of shape [1 x N] where N is the number of languages.

    Declaration

    Objective-C

    
    @interface MPPLanguageDetector : NSObject
  • Options for setting up a LanguageDetector.

    Declaration

    Objective-C

    
    @interface MPPLanguageDetectorOptions : MPPTaskOptions <NSCopying>
  • Undocumented