AI-generated Key Takeaways
-
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.
-
EntityTypecategorizes extracted entities, whileEntityExtractionModelIdentifierlists supported models for theEntityExtractor. -
EntityExtractorCallbackhandles entity extraction outcomes with annotations or errors, andEntityExtractorDownloadModelIfNeededCallbackmanages 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?) -> VoidParameters
resultAn array of annotations for the text or
nilif there’s an error.errorThe error or
nil. -
A block that is invoked when the entity extraction models are downloaded.
Declaration
Swift
typealias EntityExtractorDownloadModelIfNeededCallback = (Error?) -> VoidParameters
errorThe error or
nil.