EntityExtractionParams.Builder

public static class EntityExtractionParams.Builder extends Object

Builder class for EntityExtractionParams.

Public Constructor Summary

Builder(String text)
Creates a new builder to build EntityExtractionParams.

Public Method Summary

EntityExtractionParams
build()
Builds a EntityExtractionParams instance.
EntityExtractionParams.Builder
setEntityTypesFilter(Set<Integer> typesFilter)
Defines the subset of type (e.g.
EntityExtractionParams.Builder
setPreferredLocale(Locale preferredLocale)
Sets the preferred locale that can be used to disambiguate potential values for identified entities.
EntityExtractionParams.Builder
setReferenceTime(Long referenceTime)
Sets the reference time based on which relative dates (e.g.
EntityExtractionParams.Builder
setReferenceTimeZone(TimeZone referenceTimeZone)
Sets the reference time zone based on which relative dates (e.g.

Inherited Method Summary

Public Constructors

public Builder (String text)

Creates a new builder to build EntityExtractionParams.

Parameters
text used for entity extraction.

Public Methods

public EntityExtractionParams build ()

Builds a EntityExtractionParams instance.

public EntityExtractionParams.Builder setEntityTypesFilter (Set<Integer> typesFilter)

Defines the subset of type (e.g. Entity.TYPE_URL) that are relevant to the use case (can be a single element if only one entity type is relevant). If this is not set, all possible entity types will be returned.

public EntityExtractionParams.Builder setPreferredLocale (Locale preferredLocale)

Sets the preferred locale that can be used to disambiguate potential values for identified entities. For example, "01/02/2000" is ambiguous and could refer to either January 2nd or February 1st, but a locale preference could help pick the right one (en-US would pick the first, en-UK would pick the second).

The supported locales match the list of supported models. So any of (or a subset of): 'en-*' ('en-US', 'en-UK', 'en-CA', ...), 'ar-*', 'de-*', 'es-*', 'fr-*', 'it-*', 'ja-*', 'ko-*', 'nl-*', 'pl-*', 'pt-*', 'ru-*', 'th-*', 'tr-*', 'zh-*'

If this is not set, the device's locale will be used instead.

public EntityExtractionParams.Builder setReferenceTime (Long referenceTime)

Sets the reference time based on which relative dates (e.g. "tomorrow") should be interpreted, in milliseconds from the epoch of 1970-01-01T00:00:00Z (UTC timezone). If this is not set, the current time (when entity extraction is invoked) will be used.

public EntityExtractionParams.Builder setReferenceTimeZone (TimeZone referenceTimeZone)

Sets the reference time zone based on which relative dates (e.g. "tomorrow") should be interpreted. If this is not set, the current time zone (when entity extraction is invoked) will be used.