# MLKitEntityExtraction Framework Reference

# MLKEntityExtractor


    @interface MLKEntityExtractor : NSObject

A class that extracts entities from the given input text.
- `


  ### [+entityExtractorWithOptions:](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(cm)entityExtractorWithOptions:)


  ` Gets an `EntityExtractor` instance configured with the given options. This method is
  thread safe.

  #### Declaration

  Objective-C

      + (nonnull MLKEntityExtractor *)entityExtractorWithOptions:
          (nonnull https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractorOptions.html *)options;

  #### Parameters

  |---|---|
  | ` options ` | The options for the entity extractor. |

  #### Return Value

  An `EntityExtractor` instance with the given options.
- `


  ### [-annotateText:completion:](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(im)annotateText:completion:)


  ` Annotates the given text with the default value for `https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractionParams.html`.
  Uses the current time as the reference time and device timezone as the reference timezone.
  Annotates all supported entity types.

  #### Declaration

  Objective-C

      - (void)annotateText:(nonnull NSString *)text
                completion:(nonnull https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Type-Definitions.html#/c:MLKEntityExtractor.h@T@MLKEntityExtractorCallback)completion;

  #### Parameters

  |---|---|
  | ` text ` | The text to be annotated. |
  | ` completion ` | Handler to call back on the main queue with the entity extraction result or error. |

- `


  ### [-annotateText:withParams:completion:](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(im)annotateText:withParams:completion:)


  ` Annotates the given text with the given parameters such as reference time, reference time zone
  and entity types filter.

  #### Declaration

  Objective-C

      - (void)annotateText:(nonnull NSString *)text
                withParams:(nonnull https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractionParams.html *)params
                completion:(nonnull https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Type-Definitions.html#/c:MLKEntityExtractor.h@T@MLKEntityExtractorCallback)completion;

  #### Parameters

  |---|---|
  | ` text ` | The text to be annotated. |
  | ` params ` | The entity extraction parameters to be used during entity extraction. |
  | ` completion ` | Handler to call back on the main queue with the entity extraction result or error. |

- `


  ### [-downloadModelIfNeededWithCompletion:](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(im)downloadModelIfNeededWithCompletion:)


  ` Downloads the model files required for entity extraction with the default download conditions
  (cellular access allowed and background downloads disallowed). If model has already been
  downloaded, completes without additional work.

  #### Declaration

  Objective-C

      - (void)downloadModelIfNeededWithCompletion:
          (nonnull https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Type-Definitions.html#/c:MLKEntityExtractor.h@T@MLKEntityExtractorDownloadModelIfNeededCallback)completion;

  #### Parameters

  |---|---|
  | ` completion ` | Handler to call back on the main queue with an error, if any. |

- `


  ### [-downloadModelIfNeededWithConditions:completion:](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(im)downloadModelIfNeededWithConditions:completion:)


  ` Downloads the model files required for entity extraction when the given conditions are met. If
  model has already been downloaded, completes without additional work.

  #### Declaration

  Objective-C

      - (void)
          downloadModelIfNeededWithConditions:
              (nonnull MLKModelDownloadConditions *)conditions
                                   completion:
                                       (nonnull
                                            https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Type-Definitions.html#/c:MLKEntityExtractor.h@T@MLKEntityExtractorDownloadModelIfNeededCallback)
                                           completion;

  #### Parameters

  |---|---|
  | ` conditions ` | The downloading conditions for the translate model. |
  | ` completion ` | Handler to call back on the main queue with an error, if any. |

- `


  ### [-init](https://developers.google.com/ml-kit/reference/ios/mlkitentityextraction/api/reference/Classes/MLKEntityExtractor#/c:objc(cs)MLKEntityExtractor(im)init)


  ` Unavailable.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;