Salience

The Salience Developer Hub

Welcome to the Salience developer hub. You'll find comprehensive guides and documentation to help you start working with Salience as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Collection

SalienceCollection

Summary

The constructor instantiates a SalienceCollection object which provides access to collection-level API functionality. For document-level functionality, a Salience object should be instantiated.

The constructor provides a wrapper around the underlying C API methods lxaLoadLicense and lxaOpenSalienceSession.

Syntax

SalienceCollection(string sLicensePath, string sDataPath)

SalienceCollection(string sLicensePath, string sDataPath, string sUserDir)

SalienceCollection(string sLicensePath, string sDataPath, string sUserDir, string sLogPath)

SalienceCollection(string sLicensePath, SalienceStartup oStartup)

Parameters

sLicensePath

String containing the path to the required license file

sDataPath

String containing the path to the data directory to use for the session

sUserDir

String containing the path to a user directory of data file customizations

sLogPath

String containing the path to writable location for a startup log

oStartup

A SalienceStartup object containing startup information for the session

Returns

If successful, the constructor returns a SalienceCollection object that can be used for processing a related set of text. Otherwise, an exception is thrown with information about the failure of the constructor.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetSalienceVersion

Summary

Gets the version of the library. You can use this to display a version of the underlying Salience Engine in use. This is a wrapper around the underlying C API method lxaGetSalienceVersion.

Syntax

public string GetSalienceVersion()

Parameters

None

Returns

A string containing the version of the underlying Salience Engine library.

Example

TODO: Example needed for Salience 6

SalienceCollection.DumpEnvironment

Summary

Outputs environment information about the SalienceCollection session. This includes the data directory and user directory in use, as well as the value of any options that have been set.

This is a wrapper around the underlying C API method lxaDumpEnvironment.

Syntax

public string DumpEnvironment()

Parameters

None

Returns

A string containing the parameters of the operating environment of the current Salience session.

Example

//The SalienceEngine object wraps all of the Salience functionality 
        //and must be initialized to use the library.
        SalienceCollection Engine = null;
    
        //If this application will be run on multiple machines, it may be helpful to read these paths 
        //from a configuration file or a registry key to avoid introducing dependencies on where the 
        //license and data must be installed.
        string licensePath = "C:/Program Files/Lexalytics/License.v5";
        string dataPath = "C:/Program Files/Lexalytics/data";
    
        try
        {
            //We declared Engine before initializing it so we could put this in a try/catch block, and 
            //have the rest of the code outside.
            Engine = new SalienceCollection(licensePath, dataPath);
        }
        catch (SalienceException e)
        {
            /*If the SalienceEngine constructor throws an error, one of these is likely to be true:
             * 1) The license file is missing/invalid/out of date
             * 2) The data directory was missing or contained incorrect files
             * 3) Salience6.dll could not be found. */
            System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
            return;
        }
    
        System.Console.WriteLine(Engine.DumpEnvironment());

SalienceCollection.AddSalienceConfiguration

Summary

Supports the analysis of content through multiple user directories.

This method adds the specified user directory, with the customizations and tuning it contains, to the specified Salience session. After adding a configuration to the Salience session, additional processing options and results from various API methods can be retrieved by using the identifier provided in configurationID.

Calling this method with a value for configurationID that has been previously added will result in an error code returned.

This is a wrapper around the underlying C API method lxaAddSalienceConfiguration.

Syntax

public void AddSalienceConfiguration(String userDir, String configurationID)

Parameters

userDir

Path to a user directory to use for this configuration

configurationID

String specifying a unique identifier for this configuration

Returns

Integer return code. LXA_OK indicates success, LXA_CONFIG_IN_USE indicates the provided configuration ID has already been added to the session.

SalienceCollection.RemoveSalienceConfiguration

Summary

This method removes the specified configuration from those used in processing content in the the current Salience session.

Calling this method with a value for configurationID that has not been previously added by a call to SalienceCollection.AddSalienceConfiguration will result in an error code returned. Additionally, calling this method with an empty string (which identifies the default configuration) will result in an error.

This is a wrapper around the underlying C API method lxaRemoveSalienceConfiguration.

Syntax

public void RemoveSalienceConfiguration(String configurationID)

Parameters

configurationID

Character string specifying a unique identifier for a configuration previously added to the session

Returns

Integer return code. LXA_OK indicates success, LXA_INVALID_CONFIG indicates the provided configuration ID has already been added to the session, also returned if this method is called with an empty string for configurationID.

SalienceCollection.PrepareTextFromList

Summary

Provides a set of related pieces of content to Salience 6 for collection-level analysis. This method, or PrepareCollectionFromFile must be called for each new group of content that should be analyzed. The text provided in the set must be 7bit ASCII or valid UTF-8.

This method is a a wrapper around the underlying C API method lxaPrepareCollection.

Syntax

public int PrepareCollectionFromList(string sName, List<String> lstText)

Parameters

sName

A descriptive name for the collection

lstText

A List<> structure of strings, each representing a unique piece of content within the set.

Returns

If successful, an integer return code is returned. Developers should check the integer return code to determine if warnings were issued. Otherwise, an exception is thrown with information about the failure of text preparation.

Example

TODO: Example needed for Salience 6

SalienceCollection.PrepareTextFromFile

Summary

Provides a file containing multiple related pieces of content to Salience 6 for collection-level analysis. This method, or PrepareCollectionFromList must be called for each new group of content that should be analyzed. The text provided in the file must be 7bit ASCII or valid UTF-8.

This method is a a wrapper around the underlying C API method lxaPrepareCollectionFromFile.

Syntax

public int PrepareCollectionFromFile(string sName, string sFile)

Parameters

sName

A descriptive name for the collection

sFile

Path to a readable text file containing multiple pieces of related content

Returns

If successful, an integer return code is returned. Developers should check the integer return code to determine if warnings were issued. Otherwise, an exception is thrown with information about the failure of text preparation.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetCollectionDetails

Summary

Returns information about the collection. At present, the SalienceCollectionDetails object contains only the number of documents in the collection.

This method is a a wrapper around the underlying C API method lxaGetCollectionDetails.

Syntax

public SalienceCollectionDetails GetCollectionDetails()

Parameters

None.

Returns

If successful, a SalienceCollectionDetails object is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetThemes

Summary

Retrieves a list of themes extracted across all documents in the collection. These results can be adjusted through the available Collection Options, which must be set before this call is made.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionThemes.

Syntax

public List<SalienceTheme> GetThemes(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceTheme objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetEntities

Summary

Returns the entities from collection based on model-based or datafile-based entity extraction. Parameters to control entity extraction should be specified by setting Entity Options. Other adjustments can be made through the available Collection Options, which must be set before this call is made.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionEntities.

Syntax

public List<SalienceCollectionEntity> GetEntities(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceCollectionEntity objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetFacets

Summary

Retrieves the facets extracted across all documents in the collection. These results can be adjusted through the available Collection Options, which must be set before this call is made.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionFacets.

Syntax

public List<SalienceFacet> GetFacets(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceFacet objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetQueryDefinedTopics

Summary

Returns the topics determined for the collection via user-defined queries. Before calling this method, you must specify the topic list using the Topic List option.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionQueryDefinedTopics.

Syntax

public List<SalienceTopic> GetQueryDefinedTopics(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceTopic objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetConceptTopics

Summary

Returns the topics determined for the collection via the Salience 6 Concept Matrix. Before calling this method, you must specify a concept topic list using the Concept Topic List option.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionConceptDefinedTopics.

Syntax

public List<SalienceTopic> GetConceptTopics(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceTopic objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

SalienceCollection.GetUserEntities

Summary

Returns the user-defined entities from the collection. This is based on the entity list specified through the User Entity List option. Other adjustments can be made through the available Collection Options, which must be set before this call is made.

The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.

This method is a a wrapper around the underlying C API method lxaGetCollectionUserEntities.

Syntax

public List<SalienceCollectionEntity> GetUserEntities(String id="")

Parameters

id

Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceCollectionEntity objects is returned. Otherwise, an exception is thrown with information about the failure.

Example

TODO: Example needed for Salience 6

Updated 7 months ago

Collection


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.