AI-generated Key Takeaways
-
EntityExtractor
annotates text, identifying entities like people, locations, and organizations. -
It provides methods to annotate text, download necessary models, and manage resources.
-
annotate()
returns a list ofEntityAnnotation
objects representing identified entities. -
downloadModelIfNeeded()
ensures the required model is downloaded for entity extraction. -
close()
should be called to release resources when the extractor is no longer needed.
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>> | |
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.