AI-generated Key Takeaways
-
Globally available type definitions provide structures for entity extraction tasks.
-
These definitions include entity type, model identifier, extraction callback, and model download callback.
-
Each type definition serves a specific purpose in the entity extraction process, from categorizing entities to handling results and model downloads.
-
Developers can leverage these type definitions to interact with and manage the entity extraction features effectively.
Type Definitions
The following type definitions are available globally.
-
@enum EntityExtractionEntityType The type of an extracted entity.
Declaration
Objective-C
typedef NSString *MLKEntityExtractionEntityType -
An enumeration of models supported by
EntityExtractor.Declaration
Objective-C
typedef NSString *MLKEntityExtractionModelIdentifier -
A block that handles an entity extraction result.
Declaration
Objective-C
typedef void (^MLKEntityExtractorCallback)( NSArray<MLKEntityAnnotation *> *_Nullable, NSError *_Nullable)Parameters
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
Objective-C
typedef void (^MLKEntityExtractorDownloadModelIfNeededCallback)( NSError *_Nullable)Parameters
errorThe error or
nil.