RuntimeEntity
public struct RuntimeEntity : Codable, Equatable
A term from the request that was identified as an entity.
-
An entity detected in the input.
Declaration
Swift
public var entity: String -
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Declaration
Swift
public var location: [Int]? -
The entity value that was recognized in the user input.
Declaration
Swift
public var value: String -
A decimal percentage that represents Watson’s confidence in the recognized entity.
Declaration
Swift
public var confidence: Double? -
Deprecated. Any metadata for the entity. Beginning with the
2021-06-14API version, themetadataproperty is no longer returned. For information about system entities recognized in the user input, see theinterpretationproperty.Declaration
Swift
public var metadata: [String : JSON]? -
The recognized capture groups for the entity, as defined by the entity pattern.
Declaration
Swift
public var groups: [CaptureGroup]? -
An object containing detailed information about the entity recognized in the user input. For more information about how system entities are interpreted, see the documentation.
Declaration
Swift
public var interpretation: RuntimeEntityInterpretation? -
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-timeand@sys-dateentities when the user’s input is ambiguous. This property is included only if the new system entities are enabled for the workspace.Declaration
Swift
public var alternatives: [RuntimeEntityAlternative]? -
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the workspace.
Declaration
Swift
public var role: RuntimeEntityRole? -
Initialize a
RuntimeEntitywith member variables.Declaration
Swift
public init( entity: String, value: String, location: [Int]? = nil, confidence: Double? = nil, metadata: [String: JSON]? = nil, groups: [CaptureGroup]? = nil, interpretation: RuntimeEntityInterpretation? = nil, alternatives: [RuntimeEntityAlternative]? = nil, role: RuntimeEntityRole? = nil )Parameters
entityAn entity detected in the input.
valueThe entity value that was recognized in the user input.
locationAn array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
confidenceA decimal percentage that represents Watson’s confidence in the recognized entity.
metadataDeprecated. Any metadata for the entity. Beginning with the
2021-06-14API version, themetadataproperty is no longer returned. For information about system entities recognized in the user input, see theinterpretationproperty.groupsThe recognized capture groups for the entity, as defined by the entity pattern.
interpretationAn object containing detailed information about the entity recognized in the user input. For more information about how system entities are interpreted, see the documentation.
alternativesAn array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-timeand@sys-dateentities when the user’s input is ambiguous. This property is included only if the new system entities are enabled for the workspace.roleAn object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the workspace.
Return Value
An initialized
RuntimeEntity.
View on GitHub
RuntimeEntity Structure Reference