# Classes

The following declarations are available globally.
- `
  ### [AudioPart](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/AudioPart.md.txt)

  ` Audio part representing the audio content block of a multi-modal block.

  #### Declaration

  Swift

      class AudioPart: TaskPart

- `
  ### [BaseOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/BaseOptions.md.txt)

  ` 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

  Swift

      class BaseOptions: NSObject, NSCopying

- `
  ### [ClassificationResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/ClassificationResult.md.txt)

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

  #### Declaration

  Swift

      class ClassificationResult: NSObject

- `
  ### [Classifications](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/Classifications.md.txt)

  ` Represents the list of classification for a given classifier head. Typically used as a result for classification tasks.

  #### Declaration

  Swift

      class Classifications: NSObject

- `
  ### [Correction](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/Correction.md.txt)

  ` A single correction.

  #### Declaration

  Swift

      class Correction: NSObject

- `
  ### [Embedding](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/Embedding.md.txt)

  ` 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

  Swift

      class Embedding: NSObject

- `
  ### [EmbeddingResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/EmbeddingResult.md.txt)

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

  #### Declaration

  Swift

      class EmbeddingResult: NSObject

- `
  ### [ImagePart](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/ImagePart.md.txt)

  ` Image part representing the image content block of a multi-modal block.

  #### Declaration

  Swift

      class ImagePart: TaskPart

- `
  ### [LanguageDetector](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/LanguageDetector.md.txt)

  ` Predicts the language of an input text.

  This API expects a TFLite model with \[TFLite Model Metadata\](https://www.tensorflow.org/lite/convert/metadata")that 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

  Swift

      class LanguageDetector: NSObject

- `
  ### [LanguageDetectorOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/LanguageDetectorOptions.md.txt)

  ` Options for setting up a `LanguageDetector`.

  #### Declaration

  Swift

      class LanguageDetectorOptions: TaskOptions, NSCopying

- `
  ### [LanguageDetectorResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/LanguageDetectorResult.md.txt)

  ` Represents the results generated by `LanguageDetector`. \*

  #### Declaration

  Swift

      class LanguageDetectorResult: TaskResult, NSCopying

- `
  ### [LanguagePrediction](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/LanguagePrediction.md.txt)

  `

  #### Declaration

  Swift

      class LanguagePrediction: NSObject

- `
  ### [ResultCategory](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/ResultCategory.md.txt)

  ` 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

  Swift

      class ResultCategory: NSObject

- `
  ### [TaskOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TaskOptions.md.txt)

  ` MediaPipe Tasks options base class. Any MediaPipe task-specific options class should extend this class.

  #### Declaration

  Swift

      class TaskOptions: NSObject, NSCopying

- `
  ### [TaskPart](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TaskPart.md.txt)

  ` Represents a part of a multi-modal content block.

  #### Declaration

  Swift

      class TaskPart: NSObject

- `
  ### [TaskResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TaskResult.md.txt)

  ` MediaPipe Tasks result base class. Any MediaPipe task result class should extend this class.

  #### Declaration

  Swift

      class TaskResult: NSObject, NSCopying

- `
  ### [TextClassifier](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextClassifier.md.txt)

  ` Performs classification on text.

  This API expects a TFLite model with (optional) \[TFLite Model Metadata\](https://www.tensorflow.org/lite/convert/metadata")that contains the mandatory (described below) input tensors, output tensor, and the optional (but recommended) label items as AssociatedFiles with type TENSOR_AXIS_LABELS per output classification tensor.

  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 tensors - Three input tensors `kTfLiteInt32` of shape `[batch_size xbert_max_seq_len]` representing the input ids, mask ids, and segment ids. This input signature requires a Bert Tokenizer process unit in the model metadata. - Or one input tensor `kTfLiteInt32` of shape `[batch_size xmax_seq_len]` representing the input ids. This input signature requires a Regex Tokenizer process unit in the model metadata. - Or one input tensor (`kTfLiteString`) that is shapeless or has shape `[1]` containing the input string.

  At least one output tensor (`kTfLiteFloat32/kBool`) with: - `N` classes and shape `[1 x N]` - optional (but recommended) label map(s) as AssociatedFiles with type TENSOR_AXIS_LABELS, containing one label per line. The first such AssociatedFile (if any) is used to fill the `categoryName` field of the results. The `displayName` field is filled from the AssociatedFile (if any) whose locale matches the `displayNamesLocale` field of the `MPPTextClassifierOptions` used at creation time ("en" by default, i.e. English). If none of these are available, only the `index` field of the results will be filled.

  #### Declaration

  Swift

      class TextClassifier: NSObject

- `
  ### [TextClassifierOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextClassifierOptions.md.txt)

  ` Options for setting up a `MPPTextClassifier`.

  #### Declaration

  Swift

      class TextClassifierOptions: TaskOptions, NSCopying

- `
  ### [TextClassifierResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextClassifierResult.md.txt)

  ` Represents the classification results generated by `MPPTextClassifier`. \*

  #### Declaration

  Swift

      class TextClassifierResult: TaskResult, NSCopying

- `
  ### [TextEmbedder](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextEmbedder.md.txt)

  ` Performs embedding extraction on text.

  This API expects a TFLite model with (optional) \[TFLite Model Metadata\](https://www.tensorflow.org/lite/convert/metadata").

  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 tensors: - Three input tensors `kTfLiteInt32` of shape `[batch_size x bert_max_seq_len]` representing the input ids, mask ids, and segment ids. This input signature requires a Bert Tokenizer process unit in the model metadata. - Or one input tensor `kTfLiteInt32` of shape `[batch_size x max_seq_len]` representing the input ids. This input signature requires a Regex Tokenizer process unit in the model metadata. - Or one input tensor (`kTfLiteString`) that is shapeless or has shape `[1]` containing the input string.

  At least one output tensor (`kTfLiteFloat32`/`kTfLiteUint8`) with shape `[1 x N]` where `N` is the number of dimensions in the produced embeddings.

  #### Declaration

  Swift

      class TextEmbedder: NSObject, EmbeddingProvider

- `
  ### [TextEmbedderOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextEmbedderOptions.md.txt)

  ` Options for setting up a `MPPTextEmbedder`.

  #### Declaration

  Swift

      class TextEmbedderOptions: TaskOptions, NSCopying

- `
  ### [TextEmbedderResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextEmbedderResult.md.txt)

  ` Represents the embedding results generated by `MPPTextEmbedder`. \*

  #### Declaration

  Swift

      class TextEmbedderResult: TaskResult, NSCopying

- `
  ### [TextFormatContext](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextFormatContext.md.txt)

  ` Encapsulates formatting instructions for models that require a specific prompt format.

  #### Declaration

  Swift

      class TextFormatContext: NSObject

- `
  ### [TextPart](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextPart.md.txt)

  ` Text part representing the text content block of a multi-modal block.

  #### Declaration

  Swift

      class TextPart: TaskPart

- `
  ### [TextProofreader](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextProofreader.md.txt)

  ` Performs proofreading on text.

  This API expects a LiteRT-LM model asset bundle.

  #### Declaration

  Swift

      class TextProofreader: NSObject

- `
  ### [TextProofreaderOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextProofreaderOptions.md.txt)

  ` Options for configuring a MediaPipe text proofreader task.

  #### Declaration

  Swift

      class TextProofreaderOptions: TaskOptions, NSCopying

- `
  ### [TextProofreaderResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextProofreaderResult.md.txt)

  ` The result of a proofread operation.

  #### Declaration

  Swift

      class TextProofreaderResult: NSObject

- `
  ### [TextProofreaderStreamResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextProofreaderStreamResult.md.txt)

  ` The result of a streaming proofread operation.

  #### Declaration

  Swift

      class TextProofreaderStreamResult: NSObject

- `
  ### [TextSummarizer](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextSummarizer.md.txt)

  ` Performs summarization on text.

  This API expects a LiteRT-LM model asset bundle.

  #### Declaration

  Swift

      class TextSummarizer: NSObject

- `
  ### [TextSummarizerOptions](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextSummarizerOptions.md.txt)

  ` Options for configuring a MediaPipe text summarizer task.

  #### Declaration

  Swift

      class TextSummarizerOptions: TaskOptions, NSCopying

- `
  ### [TextSummarizerResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextSummarizerResult.md.txt)

  ` The result of a summarization operation.

  #### Declaration

  Swift

      class TextSummarizerResult: NSObject

- `
  ### [TextSummarizerStreamResult](https://developers.google.com/edge/api/mediapipe/swift/text/Classes/TextSummarizerStreamResult.md.txt)

  ` The result of a streaming summarization operation.

  #### Declaration

  Swift

      class TextSummarizerStreamResult: NSObject