EntityExtractor

  • EntityExtractor annotates text to identify referenced entities.

  • It provides methods to annotate text with or without specific parameters.

  • The extractor includes methods for downloading and checking the download status of its model.

  • EntityExtractor can be closed to release its resources.

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

From interface java.io.Closeable
abstract void
close()
From interface java.lang.AutoCloseable
abstract void
close()

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.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年10月31日 UTC.