EntityExtractor

public interface EntityExtractor extends Closeable, LifecycleObserver

Annotates a text with information about entities referenced in the text.

Public Method Summary

abstract Task<List<EntityAnnotation>>
annotate(EntityExtractionParams params)
Creates annotations for the given params, identifying entities referenced in it.
abstract Task<List<EntityAnnotation>>
annotate(String text)
Creates annotations for the given text, identifying entities referenced in it.
abstract void
close()
Closes the extractor and releases its resources.
abstract Task<Void>
downloadModelIfNeeded()
Downloads the appropriate model for the Entity Extractor.
abstract Task<Void>
downloadModelIfNeeded(DownloadConditions downloadConditions)
Downloads the appropriate model for the Entity Extractor depending on the DownloadConditions that were passed.
abstract Task<Boolean>
isModelDownloaded()
Returns true if model for the Entity Extractor is downloaded.

Inherited Method Summary

Public Methods

public abstract Task<List<EntityAnnotation>> annotate (EntityExtractionParams params)

Creates annotations for the given params, identifying entities referenced in it. Returns empty list if there is no identified entity.

public abstract Task<List<EntityAnnotation>> annotate (String text)

Creates annotations for the given text, identifying entities referenced in it. Returns empty list if there is no identified entity.

public abstract void close ()

Closes the extractor and releases its resources.

public abstract Task<Void> downloadModelIfNeeded ()

Downloads the appropriate model for the Entity Extractor. The download will be triggered as soon as there is a network connection, with no other conditions.

Returns
  • a Task that will be completed when the required files have been downloaded

public abstract Task<Void> downloadModelIfNeeded (DownloadConditions downloadConditions)

Downloads the appropriate model for the Entity Extractor depending on the DownloadConditions that were passed.

Parameters
downloadConditions the download conditions for remote model.
Returns
  • a Task that will be completed when the required files have been downloaded

public abstract Task<Boolean> isModelDownloaded ()

Returns true if model for the Entity Extractor is downloaded.