Class Entity

java.lang.Object
com.lexalytics.salience.Entity

public class Entity
extends java.lang.Object

An entity is an object that exists within the content. These fall into two main classes, named entities and user-defined entities.

Salience extracts entities from document content primarily by calls to Salience.getNamedEntities() and Salience.getUserEntities().

A "named entity" is one extracted through the entity extraction model, with the aid of any CDL files created by users to aid entity extraction. The main types of named entities are Company, Person, Place, and Product. In addition, you will see Pattern and List entities.

A "user-defined entity" is one extracted through a user entity file that can use query logic to define the entity. The user entity list must be specified using the Options.EntityOptions.setUserEntityList(java.lang.String) option.

  • Constructor Summary

    Constructors 
    Constructor Description
    Entity​(java.util.Vector<Mention> vMentions, java.lang.String sType, java.lang.String sLabel, java.lang.String sNormalizedForm, float fSentimentScore, int nEvidence, boolean bConfident, boolean bAbout, java.lang.String sSummary, java.util.Vector<Theme> vThemes, java.util.Vector<EntityAttribute> vEntityAttributes, java.util.Vector<Topic> vTopics, java.util.Vector<SentimentPhrase> vSentimentPhrases, java.util.Map<java.lang.String,​java.util.Set<Entity>> mRelatedEntities)
    Creates a new entity.
  • Method Summary

    Modifier and Type Method Description
    java.util.Vector<EntityAttribute> getEntityAttributes()
    A list of entityattributes related to this entity.
    int getEvidence()
    Evidence is a measure of the content available to determine the sentiment score for the entity.
    java.lang.String getLabel()
    A descriptive label for the entity.
    java.util.Vector<Mention> getMentions()
    A list of entity mentions within the content.
    java.lang.String getNormalizedForm()
    The normalized for of the entity.
    java.util.Map<java.lang.String,​java.util.Set<Entity>> getRelatedEntities()  
    java.util.Vector<SentimentPhrase> getSentimentPhrases()
    A list of sentiment bearing phrases related to the entity.
    float getSentimentScore()
    Sentiment score associated with content related to the entity.
    java.lang.String getSummary()
    A summary of content related to the entity.
    java.util.Vector<Theme> getThemes()
    A list of themes related to this entity.
    java.util.Vector<Topic> getTopics()
    Added in Salience 5.1: A list of topics related to the entity.
    java.lang.String getType()
    The entity type is a general classification of the entity, as determined by the entity extraction model or data file customizations to specify the entity type.
    boolean isAbout()
    Boolean indicator of theme "aboutness".
    boolean isConfident()
    An flag indicating if the entity has match confidence queries defined in the data files.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Entity

      public Entity​(java.util.Vector<Mention> vMentions, java.lang.String sType, java.lang.String sLabel, java.lang.String sNormalizedForm, float fSentimentScore, int nEvidence, boolean bConfident, boolean bAbout, java.lang.String sSummary, java.util.Vector<Theme> vThemes, java.util.Vector<EntityAttribute> vEntityAttributes, java.util.Vector<Topic> vTopics, java.util.Vector<SentimentPhrase> vSentimentPhrases, java.util.Map<java.lang.String,​java.util.Set<Entity>> mRelatedEntities)
      Creates a new entity. This is not intended for client use. Entities are created by Salience Engine when entity-related API methods are called.
      Parameters:
      vMentions - A Vector of entity Mention objects giving information about occurrences within the text.
      sType - The entity type (ex. Company, Person, Place, Product, List, Pattern).
      sLabel - A descriptive label for the entity.
      sNormalizedForm - The normalized form of the entity across all mentions.
      fSentimentScore - Sentiment score for the entity.
      nEvidence - Measure of evidence used to determine sentiment, on a scale of 1 to 7.
      bConfident - Boolean flag related to confidence queries.
      bAbout - Boolean flag indicating that the theme occurs in the internal summary of the document.
      sSummary - A summary of content related to the entity.
      vThemes - A Vector of Theme objects related to the entity.
      vEntityAttributes - A Vector of EntityAttribute objects related to the entity.
      vTopics - Added in Salience 5.1: A Vector of Topic objects giving topics related to the entity.
      vSentimentPhrases - A Vector of SentimentPhrase objects giving the entity its sentiment
      mRelatedEntities - A Map of Sets of Entity objects related in some way to this entity
  • Method Details

    • getMentions

      public java.util.Vector<Mention> getMentions()
      A list of entity mentions within the content.
      Returns:
      A Vector of Salience Phrase objects. These provide positional information about the occurrences of the entity within the content.
    • getType

      public java.lang.String getType()
      The entity type is a general classification of the entity, as determined by the entity extraction model or data file customizations to specify the entity type. The main entity types are Company, Person, Place, and Product.
      Returns:
      A String object containing the type of this entity (e.g. Person).
    • getNormalizedForm

      public java.lang.String getNormalizedForm()
      The normalized for of the entity. For example, an entity may appear as "George Washington", "he", "George". The normalized form would be "George Washington".
      Returns:
      A String object containing the normalized form of this entity (e.g. George Washington).
    • getLabel

      public java.lang.String getLabel()
      A descriptive label for the entity. This may be the same as the entity type, but can be customized in data files. For example, the entity "George Washington" would have a type "Person" and could have the label "Politician".
      Returns:
      A String object containing the label for this entity (e.g. Politician).
    • getSentimentScore

      public float getSentimentScore()
      Sentiment score associated with content related to the entity.
      Returns:
      Sentiment score determined for a entity.
    • getEvidence

      public int getEvidence()
      Evidence is a measure of the content available to determine the sentiment score for the entity.
      Returns:
      The evidence score. This is on a scale of 1 to 7, where evidence values greater than 4 indicate a reasonable amount of content for sentiment detection.
    • isConfident

      public boolean isConfident()
      An flag indicating if the entity has match confidence queries defined in the data files.
      Returns:
      Boolean value indicating if the confidence queries matched for this entity.
    • isAbout

      public boolean isAbout()
      Boolean indicator of theme "aboutness". This is flag is true if the entity occurs within the summary of the document that Salience calculates internally.
      Returns:
      Boolean flag indicating theme "aboutness".
    • getSummary

      public java.lang.String getSummary()
      A summary of content related to the entity.
      Returns:
      A String object containing a summary of the document text that pertains to this entity.
    • getThemes

      public java.util.Vector<Theme> getThemes()
      A list of themes related to this entity.
      Returns:
      A Vector of Theme objects that are related to the entity.
    • getEntityAttributes

      public java.util.Vector<EntityAttribute> getEntityAttributes()
      A list of entityattributes related to this entity.
      Returns:
      A Vector of EntityAttribute objects that are related to the entity.
    • getTopics

      public java.util.Vector<Topic> getTopics()
      Added in Salience 5.1: A list of topics related to the entity.
      Returns:
      A Vector of Salience Topic objects. These are controlled by the Options.EntityOptions.setEntityTopics(boolean) option, and provide topics detected that are related to the entity.
    • getSentimentPhrases

      public java.util.Vector<SentimentPhrase> getSentimentPhrases()
      A list of sentiment bearing phrases related to the entity.
      Returns:
      A Vector of SentimentPhrase objects giving the entity its sentiment
    • getRelatedEntities

      public java.util.Map<java.lang.String,​java.util.Set<Entity>> getRelatedEntities()