Package com.basistech.rosette.dm
Class Entity
java.lang.Object
com.basistech.rosette.dm.BaseAttribute
com.basistech.rosette.dm.Entity
- All Implemented Interfaces:
Serializable
A reference to a "real world" entity. Each entity in a document is
the result of resolving one or more
Mention
s -- a Mention
is a span of text that mentions an entity, while an Entity
describes the entity itself.
Each Entity provides:
- a list of Mentions
- the index of the head Mention in the mentions' list
- the type of the entity, e.g. PERSON
- (optionally) a salience score
- (optionally) an ID that associates the entity some external knowledge base, e.g. Q23 from Wikidata.
- (optionally) a sentiment category associated with it (e.g. "positive", "negative", "neutral").
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.basistech.rosette.dm.BaseAttribute
extendedProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the confidence for this resolved entity, or null if there is none.Returns the unique identifier of this entity.Return the head mention index, if any.If salience was computed for this entity, return it.Returns the sentiment of this entity, or null if not computed.getType()
If there is a type established for the entity, return the type.protected com.google.common.base.MoreObjects.ToStringHelper
Methods inherited from class com.basistech.rosette.dm.BaseAttribute
getExtendedProperties, listOrNull, setExtendedProperty, toString
-
Constructor Details
-
Entity
-
-
Method Details
-
getEntityId
Returns the unique identifier of this entity.- Returns:
- the unique identifier of this entity
-
getMentions
- Returns:
- the list of mentions that support this entity.
-
getHeadMentionIndex
Return the head mention index, if any. The head mention is the mention judged to be the best representation of the entity itself. This returnsnull
if no mention is designated as head.- Returns:
- the index of the head mention.
-
getConfidence
Returns the confidence for this resolved entity, or null if there is none.- Returns:
- the confidence for this resolved entity, or null if there is none
-
getSentiment
Returns the sentiment of this entity, or null if not computed.- Returns:
- the sentiment of this entity, or null if not computed.
-
getType
If there is a type established for the entity, return the type.- Returns:
- the entity type, or
null
if none was established.
-
getSalience
If salience was computed for this entity, return it.- Returns:
- the salience value, or
null
if none was calculated.
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()- Overrides:
toStringHelper
in classBaseAttribute
-