Package com.basistech.rosette.dm
Class Entity.Builder
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<Entity,Entity.Builder>
com.basistech.rosette.dm.Entity.Builder
- Enclosing class:
- Entity
A builder for resolved entities.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns an immutable resolved entity from the current state of the builder.confidence
(Double confidence) Specifies the confidence value of the resolved entity.Specifies the entity unique ID.protected Entity.Builder
getThis()
headMentionIndex
(Integer headMentionIndex) Specifies the index of the head mention in the list of mentions, if any.Add one mention to the mentions.Specify the salience for this entity.sentiment
(CategorizerResult sentiment) Specifies the sentiment.Specify the type for this entity.Methods inherited from class com.basistech.rosette.dm.BaseAttribute.Builder
addAllToList, addAllToSet, buildExtendedProperties, extendedProperties, extendedProperty, nullOrList
-
Constructor Details
-
Builder
public Builder()Constructs a builder from the required values. -
Builder
Constructs a builder by copying values from an existing resolved entity.- Parameters:
toCopy
- the object to create
-
-
Method Details
-
entityId
Specifies the entity unique ID.- Parameters:
entityId
- the ID- Returns:
- this
-
mention
Add one mention to the mentions.- Parameters:
mention
- the mention.- Returns:
- this.
-
headMentionIndex
Specifies the index of the head mention in the list of mentions, if any.- Parameters:
headMentionIndex
- the index.- Returns:
- this.
-
confidence
Specifies the confidence value of the resolved entity.- Parameters:
confidence
- the confidence value- Returns:
- this
-
sentiment
Specifies the sentiment.- Parameters:
sentiment
- the sentiment- Returns:
- this
-
type
Specify the type for this entity.- Parameters:
type
- the type- Returns:
- this
-
salience
Specify the salience for this entity.- Parameters:
salience
- salience value.- Returns:
- this
-
build
Returns an immutable resolved entity from the current state of the builder.- Returns:
- the new resolved entity
-
getThis
- Specified by:
getThis
in classBaseAttribute.Builder<Entity,
Entity.Builder>
-