Class Salience

java.lang.Object
com.lexalytics.salience.Salience
All Implemented Interfaces:
ISalience

public class Salience
extends java.lang.Object
implements ISalience

The Salience object encapsulates the document-level text analytics functionality available from Salience Engine. The object represents a Salience session, and allows the user to process document for entities, sentiment, themes, etc.

You can have multiple Salience sessions active at the same time, either to increase throughput or to process documents with different sets of customizations to the data directory. However, you should NOT instantiate a new Salience session for each document to be processed.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.lexalytics.salience.ISalience

    ISalience.Warning
  • Field Summary

    Fields 
    Modifier and Type Field Description
    Options options
    Access to the Options for this Salience session.
  • Constructor Summary

    Constructors 
    Constructor Description
    Salience​(java.lang.String sLicenseFile, java.lang.String sDataPath)
    Creates a new Salience session.
    Salience​(java.lang.String sLicenseFile, java.lang.String sDataPath, boolean bShortContentMode)
    Creates a new Salience session.
    Salience​(java.lang.String sLicenseFile, java.lang.String sDataPath, java.lang.String sLogPath)
    Creates a new Salience session.
    Salience​(java.lang.String sLicenseFile, java.lang.String sDataPath, java.lang.String sLogPath, boolean bShortContentMode)
    Creates a new Salience session.
    Salience​(java.lang.String sLicenseFile, java.lang.String sDataPath, java.lang.String sLogPath, java.lang.String sLogConfigurationPath, boolean bShortContentMode)
    Creates a new Salience session.
  • Method Summary

    Modifier and Type Method Description
    void AddLabelFilter​(java.lang.String sLabel, java.lang.String sText, java.lang.String sConfigurationID)
    Add a basic label filter.
    void addSalienceConfiguration​(java.lang.String sUserPath, java.lang.String sConfigurationID)
    Add a user directory session.
    void addSection​(java.lang.String sHeader, java.lang.String sText, boolean bProcess)
    Adds the supplied document into a section for analysis.
    void addSectionFromFile​(java.lang.String sHeader, java.lang.String sFile, boolean bProcess)
    Adds a document from disk into a section for analysis.
    java.lang.String AddSentimentRule​(java.lang.String sTextToAlter, float fSentiment, java.lang.String sConfigurationID)
    Add a basic sentiment rule.
    java.lang.String AddSentimentRule​(java.lang.String sTextToAlter, java.lang.String sSentiment, java.lang.String sConfigurationID)
    Add a basic sentiment rule.
    java.util.Vector<BasicLabel> ApplyFilters​(java.lang.String sText, java.lang.String sConfigurationID)
    Apply a basic label filter.
    java.lang.String CorrectOCRErrors​(java.util.Vector<OCRCharacterAttribute> vAttributes, float fThreshold)
    Corrects likely OCR errors found in prepared text.
    void DeleteLabelFilter​(java.lang.String sLabel, java.lang.String sConfigurationID)
    Delete a basic label filter.
    void DeleteSentimentRule​(java.lang.String sRuleID, java.lang.String sConfigurationID)
    Delete a sentment rule in the given configuration.
    void disableCallback​(boolean bDisable)
    Enables or disables callback messaging
    void disableCallback​(boolean bDisable, java.lang.String sConfigurationID)
    Enables or disables callback messaging
    void dispose()
    Frees all resources associated with this Salience session.
    java.lang.String dumpEnvironment()
    Returns a representation of the internal state of Salience, specifically the values for Salience Options.
    java.lang.String explainConceptMatches()
    Returns a string listing the principal words in a document that contributed to each Concept Topic Match.
    java.lang.String explainConceptMatches​(java.lang.String sConfigurationID)
    Returns a string listing the principal words in a document that contributed to each Concept Topic Match.
    java.util.Vector<Topic> getConceptTopics()
    Returns a list of topics identified for the document via concepts.
    java.util.Vector<Topic> getConceptTopics​(java.lang.String sConfigurationID)
    Returns a list of topics identified for the document via concepts.
    java.util.Vector<Topic> getDocumentCategories()
    Returns a list of topics identified for the document via the category model.
    java.util.Vector<Topic> getDocumentCategories​(java.lang.String sConfigurationID)
    Returns a list of topics identified for the document via the category model.
    java.util.Vector<Topic> getDocumentClasses()
    Gets the classes for the specified document
    java.util.Vector<Topic> getDocumentClasses​(java.lang.String sConfigurationID)
    Gets the classes for the specified document
    DocumentDetails getDocumentDetails()
    Retrieves statistical information about the document.
    DocumentDetails getDocumentDetails​(java.lang.String sConfigurationID)
    Retrieves statistical information about the document.
    java.util.Vector<Intention> getDocumentIntentions()
    Calculates a list of intentions in the document.
    java.util.Vector<Intention> getDocumentIntentions​(java.lang.String sConfigurationID)
    Calculates a list of intentions in the document.
    DocumentSentiment getDocumentSentiment​(boolean bUseChains)
    Calculates an overall sentiment score for the current document.
    DocumentSentiment getDocumentSentiment​(boolean bUseChains, java.lang.String sConfigurationID)
    Calculates an overall sentiment score for the current document.
    java.util.Vector<Theme> getDocumentThemes()
    Calculates a list of themes in the document.
    java.util.Vector<Theme> getDocumentThemes​(java.lang.String sConfigurationID)
    Calculates a list of themes in the document.
    java.util.Vector<Topic> getDocumentTopics()
    Returns a list of topics identified for the document via query.
    java.util.Vector<Topic> getDocumentTopics​(java.lang.String sConfigurationID)
    Returns a list of topics identified for the document via query.
    java.lang.String getEntityTaggedText()
    Gets the document text with any entity references tagged.
    java.lang.String getEntityTaggedText​(java.lang.String sConfigurationID)
    Gets the document text with any entity references tagged.
    java.util.EnumSet<ISalience.Warning> getLastWarnings()
    Gets any warnings issued by the last call to prepareText(java.lang.String) or prepareTextFromFile(java.lang.String) made using this session.
    java.util.Vector<Entity> getNamedEntities()
    Retrieves a list of named entities in the current document.
    java.util.Vector<Entity> getNamedEntities​(java.lang.String sConfigurationID)
    Retrieves a list of named entities in the current document.
    java.util.List<Opinion> getNamedEntityOpinions()
    Returns a list of opinions expressed in a document about named entities.
    java.util.List<Opinion> getNamedEntityOpinions​(java.lang.String sConfigurationID)
    Returns a list of opinions expressed in a document about named entities.
    java.util.Vector<Relationship> getNamedEntityRelationships()
    Extracts a list of relationships between named entities in the document.
    java.util.Vector<Relationship> getNamedEntityRelationships​(java.lang.String sConfigurationID)
    Extracts a list of relationships between named entities in the document.
    java.lang.String getNamedOpinionTaggedText()
    Tags opinions expressed in a document about/expressed by named entities
    java.lang.String getNamedOpinionTaggedText​(java.lang.String sConfigurationID)
    Tags opinions expressed in a document about/expressed by named entities
    Options getOptions()  
    java.lang.String getPOSTaggedText()
    Tags the text of the document with part of speech information.
    java.lang.String getPOSTaggedText​(java.lang.String sConfigurationID)
    Tags the text of the document with part of speech information.
    java.lang.String getSentimentTaggedText()
    Tags any phrases in the document that would contribute to sentiment calculation by whether they are positive, negative or neutral.
    java.lang.String getSentimentTaggedText​(java.lang.String sConfigurationID)
    Tags any phrases in the document that would contribute to sentiment calculation by whether they are positive, negative or neutral.
    Summary getSummary​(int nLength)
    Generates a summary of the current document (the last text passed to prepareText(java.lang.String) or prepareTextFromFile(java.lang.String)).
    Summary getSummary​(int nLength, java.lang.String sConfigurationID)
    Generates a summary of the current document (the last text passed to prepareText(java.lang.String) or prepareTextFromFile(java.lang.String)).
    java.util.Vector<Entity> getUserEntities()
    Retrieves a list of entities from a supplied list that appear in the current document.
    java.util.Vector<Entity> getUserEntities​(java.lang.String sConfigurationID)
    Retrieves a list of entities from a supplied list that appear in the current document.
    java.util.List<Opinion> getUserEntityOpinions()
    Returns a list of opinions expressed in a document about user entities
    java.util.List<Opinion> getUserEntityOpinions​(java.lang.String sConfigurationID)
    Returns a list of opinions expressed in a document about user entities
    java.util.Vector<Relationship> getUserEntityRelationships()
    Extracts a list of relationships between user entities in the document.
    java.util.Vector<Relationship> getUserEntityRelationships​(java.lang.String sConfigurationID)
    Extracts a list of relationships between user entities in the document.
    java.lang.String getUserEntityTaggedText()
    Tags references to user entities from a file found in the text of the document.
    java.lang.String getUserEntityTaggedText​(java.lang.String sConfigurationID)
    Tags references to user entities from a file found in the text of the document.
    java.lang.String getUserOpinionTaggedText()
    Tags opinions expressed in a document about/expressed by user entities
    java.lang.String getUserOpinionTaggedText​(java.lang.String sConfigurationID)
    Tags opinions expressed in a document about/expressed by user entities
    java.util.Vector<QueryInfo> getValidateConceptQueryFile​(java.lang.String sFile)
    Validates concept queries from a provided query file, returning information about each query including error messages if the query was malformed.
    java.util.Vector<QueryInfo> getValidateConceptQueryString​(java.lang.String sQueries)
    Validates concept queries presented as a string, returning information about each query including error messages if the query was malformed.
    java.util.Vector<QueryInfo> getValidateQueryFile​(java.lang.String sFile)
    Validates queries from a provided query file, returning information about each query including error messages if the query was malformed.
    java.util.Vector<QueryInfo> getValidateQueryFile​(java.lang.String sFile, java.lang.String sConfigurationId)
    Validates queries from a provided query file, returning information about each query including error messages if the query was malformed.
    java.util.Vector<QueryInfo> getValidateQueryString​(java.lang.String sQueries)
    Validates queries presented as a string, returning information about each query including error messages if the query was malformed.
    java.util.Vector<QueryInfo> getValidateQueryString​(java.lang.String sQueries, java.lang.String sConfigurationId)
    Validates queries presented as a string, returning information about each query including error messages if the query was malformed.
    static java.lang.String getVersion()
    Gets the version of Salience.
    java.util.Vector<BasicLabel> ListLabelFilters​(java.lang.String sConfigurationID)
    List the basic label filters.
    java.util.Vector<BasicSentimentRule> ListSentimentRules​(java.lang.String sConfigurationID)
    List the basic sentiment rules for the given configuration.
    void prepareText​(java.lang.String sText)
    Prepares the supplied document for analysis.
    void prepareTextFromFile​(java.lang.String sFile)
    Prepares a document from disk for analysis.
    void removeSalienceConfiguration​(java.lang.String sConfigurationID)
    Remove a user directory session.
    void retrainModel​(java.lang.String sModelIn, java.lang.String sModelOut, java.lang.String sNewAnnotationsIn, java.lang.String sNewClassmapIn)
    Takes an existing trained ML Model, adds newly provided data in the form of about .lexas annotation file (with corresponding classmap) and reruns the training of the model with the exact hyperparameters used to train it initially.
    void RunModelSmokeTest​(java.util.Vector<ModelSmokeTestReport> vSuccesses, java.util.Vector<ModelSmokeTestReport> vFailures, java.lang.String sConfigurationID)  
    void SetOption​(int id, boolean value, java.lang.String sConfigurationID)
    Sets an option that requires a boolean value.
    void SetOption​(int id, float value, java.lang.String sConfigurationID)
    Sets an option that requires a float value.
    void SetOption​(int id, int value, java.lang.String sConfigurationID)
    Sets an option that requires an integer value.
    void SetOption​(int id, int intValue, java.lang.String stringValue, java.lang.String sConfigurationID)
    Sets an option that requires a String value and an integer value.
    void SetOption​(int id, java.lang.String value, java.lang.String sConfigurationID)
    Sets an option that requires a String value.
    void SetOptionsWithFile​(java.lang.String sOptionPath, java.lang.String sConfigurationID)
    Sets all options specified in the provided tab delimited file
    void SetOptionWithString​(java.lang.String sOption, java.lang.String sConfigurationID)
    Sets all options specified in the provided String

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait