TextClassifier.EntityConfig


class TextClassifier.EntityConfig


Configuration object for specifying what entities to identify. Configs are initially based on a predefined preset, and can be modified from there.

Summary

Public functions

java-static TextClassifier.EntityConfig

Extracts an EntityConfig from a bundle that was added using toBundle.

(Mutable)Collection<String!>

Retrieves the list of hints.

(Mutable)Collection<String!>!
resolveTypes(typesFromTextClassifier: (Mutable)Collection<String!>?)

Returns a final list of entity types that the text classifier should look for.

Boolean

Return whether the client allows the text classifier to include its own list of default entity types.

Bundle

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle.

Public functions

createFromBundle

java-static fun createFromBundle(bundle: Bundle): TextClassifier.EntityConfig

Extracts an EntityConfig from a bundle that was added using toBundle.

getHints

fun getHints(): (Mutable)Collection<String!>

Retrieves the list of hints.

Returns
(Mutable)Collection<String!>

An unmodifiable collection of the hints.

resolveTypes

fun resolveTypes(typesFromTextClassifier: (Mutable)Collection<String!>?): (Mutable)Collection<String!>!

Returns a final list of entity types that the text classifier should look for.

NOTE: This method is intended for use by text classifier.

Parameters
typesFromTextClassifier: (Mutable)Collection<String!>?

entity types the text classifier thinks should be included before factoring in the included/excluded entity types given by the client.

shouldIncludeTypesFromTextClassifier

fun shouldIncludeTypesFromTextClassifier(): Boolean

Return whether the client allows the text classifier to include its own list of default entity types. If this functions returns true, text classifier can consider to specify its own list in resolveTypes.

NOTE: This method is intended for use by text classifier.

See also
resolveTypes

toBundle

fun toBundle(): Bundle

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle.