MLKitEntityExtraction Framework Reference

  • This documentation details globally available type definitions for ML Kit Entity Extraction.

  • The types define entities, models, callbacks for results, and callbacks for model downloads.

  • EntityType categorizes extracted entities, while EntityExtractionModelIdentifier lists supported models for the EntityExtractor.

  • EntityExtractorCallback handles entity extraction outcomes with annotations or errors, and EntityExtractorDownloadModelIfNeededCallback manages model download completion.

Type Definitions

The following type definitions are available globally.

  • @enum EntityExtractionEntityType The type of an extracted entity.

    Declaration

    Swift

    struct EntityType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • An enumeration of models supported by EntityExtractor.

    Declaration

    Swift

    struct EntityExtractionModelIdentifier : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable
  • A block that handles an entity extraction result.

    Declaration

    Swift

    typealias EntityExtractorCallback = ([MLKEntityAnnotation]?, Error?) -> Void

    Parameters

    result

    An array of annotations for the text or nil if there’s an error.

    error

    The error or nil.

  • A block that is invoked when the entity extraction models are downloaded.

    Declaration

    Swift

    typealias EntityExtractorDownloadModelIfNeededCallback = (Error?) -> Void

    Parameters

    error

    The error or nil.