Salience Constructor
Summary
The constructor instantiates a Salience object which provides access to document-level API functionality. For collection-level functionality, a SalienceCollection object should be instantiated.
The constructor provides a wrapper around the underlying C API methods lxaLoadLicense and lxaOpenSalienceSession.
Syntax
Salience(string sLicensePath, string sDataPath)
Salience(string sLicensePath, string sDataPath, string sUserDir)
Salience(string sLicensePath, string sDataPath, string sUserDir, string sLogPath)
Salience(string sLicensePath, string sDataPath, string sUserDir, string sLogPath, SALIENCE_MODE nSalienceMode)
Salience(string sLicensePath, SalienceStartup oStartup)
Parameters
| String containing the path to the required license file |
---|---|
| String containing the path to the data directory to use for the session |
| String containing the path to a user directory of data file customizations |
| String containing the path to writable location for a startup log |
| An integer SALIENCE_MODE value specifying an optional mode for Salience |
| A SalienceStartup object containing startup information for the session |
Returns
If successful, the constructor returns a Salience object that can be used for processing text. Otherwise, an exception is thrown with information about the failure of the constructor.
Example
//The SalienceEngine object wraps all of the Salience functionality
//and must be initialized to use the library.
Salience 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 Salience(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;
}
Salience.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
//The SalienceEngine object wraps all of the Salience functionality
//and must be initialized to use the library.
Salience 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 Salience(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("SalienceEngine version: " + Engine.GetSalienceVersion());
Salience.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
| Path to a user directory to use for this configuration |
---|---|
| 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.
Back to top
Salience.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 Salience.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
| 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
.
Back to top
Salience.GetDefaultSalienceLocation
Summary
Gets the root location for the Salience installation. On Windows, this is based on the value of a registry key created during install. On Linux, it is based on the lxainstall
environment variable.
This is a wrapper around the underlying C API method lxaGetDefaultSalienceLocation.
Syntax
public static string GetDefaultSalienceLocation()
Parameters
None
Returns
Character string providing path specified as the location for the current Salience installation.
Back to top
Salience.DumpEnvironment
Summary
Outputs environment information about the Salience 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.
Salience 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 Salience(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());
Salience.GetLastWarnings
Summary
Gets the last warnings issued on a session. If you get a return of LXA_OK_WITH_WARNINGS on a function call then you can call this function to find out what the warnings were. This is a wrapper around the underlying lxaGetLastWarnings API function.
Syntax
public int GetLastWarnings()
Parameters
None.
Returns
If successful, the method returns an integer bitmask of the warnings that have occurred. An explanation of these can be found on the Errors and Warning Codes page.
Example
int errorcode = Engine.GetLastWarnings();
Salience.AddSentimentDictionary
Summary
This method is used to apply different sentiment hand-score dictionaries (HSDs) to the sentiment analysis of documents.
Note that this method has been carried over from the .Net wrapper for Salience 4.4. The Salience 6 C API has replaced the previous underlying method with options, which that wrapper method sets appropriately.
Syntax
public int AddSentimentDictionary(string sDictionary, bool bReset)
Parameters
| String containing the path to a sentiment hand-scored dictionary (HSD) |
| Flag to clear all previously loaded HSD files |
Returns
If successful, returns an integer return code. Otherwise, an exception is thrown with information about the failure.
Example
//<param name="sDictionary">Path to a sentiment hand-scored dictionary (HSD).</param>
// <param name="bReset">Flag to clear all previously loaded HSD files</param>
int errorCode = Engine.AddSentimentDictionary("C:/Files/FileToLoad.hsd", false);
Salience.PrepareText
Summary
Provides a piece of text to Salience 6 for analysis. This method, or PrepareTextFromFile must be called for each new piece of text that should be analyzed. The text must be 7bit ASCII or valid UTF-8.
This method is a a wrapper around the underlying C API method lxaPrepareText.
Syntax
public int PrepareText(string sText)
Parameters
| String containing the text to be analyzed |
---|
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.
Notes
Words that exceed 366 characters in length will be truncated. This is twice the length of the longest English word which is not a chemical compound.
Sentences that exceed 1000 words will cause the underlying call to lxaPrepareText to return with LXA_ERROR.
Example
//The SalienceEngine object wraps all of the Salience functionality
//and must be initialized to use the library.
Salience 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 Salience(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;
}
int nRet = Engine.PrepareText("Lexalytics is headquartered in Amherst, MA");
if (nRet==0)
{
....
}
Salience.PrepareTextFromFile
Summary
Provides a path to a text file to Salience 6 for analysis. This method, or PrepareText must be called for each new piece of text that should be analyzed. The contents of the text file must be 7bit ASCII or valid UTF-8.
This method is a a wrapper around the underlying C API method lxaPrepareTextFromFile.
Syntax
public int PrepareTextFromFile(string sFile)
Parameters
| Full path to a readable text file |
---|
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.
Notes
Words that exceed 366 characters in length will be truncated. This is twice the length of the longest English word which is not a chemical compound.
Sentences that exceed 1000 words will cause the underlying call to lxaPrepareTextFromFile to return with LXA_ERROR.
Example
//The SalienceEngine object wraps all of the Salience functionality
//and must be initialized to use the library.
Salience 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 Salience(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;
}
int nRet = Engine.PrepareTextFromFile("C:/Testing/aFile.txt");
if (nRet==0)
{
....
}
Salience.AddSection
Summary
Adds the supplied text into a section of the document for analysis. The supplied text should be UTF-8 encoded, not UTF-16.
This method is a a wrapper around the underlying C API method lxaAddSection.
Syntax
public int AddSection(string sHeader, string sText, bool bProcess)
Parameters
| Header or title for the text to be processed |
---|---|
| The text to be processed |
| Whether to use this text for processing or not |
Returns
If successful, an integer return code is returned. Developers should check the integer return code to determine if warnings were issued.
Back to top
Salience.AddSectionFromFile
Summary
Adds the text from the supplied file into a section of the document for analysis. The supplied text should be UTF-8 encoded, not UTF-16.
This method is a a wrapper around the underlying C API method lxaAddSectionFromFile.
Syntax
public int AddSectionFromFile(string sHeader, string sFile, bool bProcess)
Parameters
| Header or title for the text to be processed |
---|---|
| Full path to a readable text file |
| Whether to use this text for processing or not |
Returns
If successful, an integer return code is returned. Developers should check the integer return code to determine if warnings were issued.
Back to top
Salience.GetDocumentDetails
Summary
Returns an object containing various pieces of information about the document. This includes statistical information such as the number of words and sentences, as well as analytical information such as term frequency counts.
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 lxaGetDocumentDetails.
Syntax
public SalienceDocumentDetails GetDocumentDetails(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, a SalienceDocumentDetails object is returned. Otherwise, an exception is thrown with information about the failure.
Example
Salience Engine = null;
string licensePath = "C:/Program Files/Lexalytics/License.v5";
string dataPath = "C:/Program Files/Lexalytics/data";
try
{
Engine = new Salience(licensePath, dataPath);
}
catch (SalienceException e)
{
System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
return;
}
int nRet = Engine.PrepareText("Lexalytics is headquartered in Amherst, MA");
if (nRet==0)
{
SalienceDocumentDetails myDetails = Engine.GetDocumentDetails(String.Empty);
....
}
Salience.GetSummary
Summary
Returns an object containing summary results for the document.
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 wrapper around the underlying C API method lxaGetSummary.
Syntax
public SalienceSummary GetSummary(int nLength, String id="")
Parameters
| Length of the summary in number of sentences |
---|---|
| Optional: The identifier for a specific configuration for results. |
Returns
If successful, a SalienceSummary object is returned. Otherwise, an exception is thrown with information about the failure.
Example
Salience Engine = null;
string licensePath = "C:/Program Files/Lexalytics/License.v5";
string dataPath = "C:/Program Files/Lexalytics/data";
try
{
Engine = new Salience(licensePath, dataPath);
}
catch (SalienceException e)
{
System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
return;
}
int nRet = Engine.PrepareTextFromFile("path\to\file");
if (nRet==0)
{
SalienceSummary mySummary = new SalienceSummary();
mySummary = Engine.GetSummary(3, String.Empty);
System.Console.WriteLine(mySummary.sSummary);
....
}
Salience.GetDocumentSentiment
Summary
Returns an object containing results of sentiment analysis on the document. This includes phrase-based sentiment analysis as well as the results of model-based sentiment analysis.
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 lxaGetSentiment.
Syntax
public SalienceSentiment GetDocumentSentiment(bool bUseChains, String id="")
Parameters
| Determines if chains are used to calculate sentiment |
---|---|
| Optional: The identifier for a specific configuration for results. |
Returns
If successful, a SalienceSentiment object is returned. Otherwise, an exception is thrown with information about the failure.
Example
Salience Engine = null;
string licensePath = "C:/Program Files/Lexalytics/License.v5";
string dataPath = "C:/Program Files/Lexalytics/data";
try
{
Engine = new Salience(licensePath, dataPath);
}
catch (SalienceException e)
{
System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
return;
}
int nRet = Engine.PrepareText("Lexalytics is headquartered in Amherst, MA");
if (nRet==0)
{
SalienceSentiment mySentiment = Engine.GetDocumentSentiment(true, String.Empty);
....
}
Salience.GetDocumentThemes
Summary
Returns a list of themes for the document.
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 lxaGetThemes.
Syntax
public List<SalienceTheme> GetDocumentThemes(String id="")
Parameters
| 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
Salience Engine = null;
string licensePath = "C:/Program Files/Lexalytics/License.v5";
string dataPath = "C:/Program Files/Lexalytics/data";
try
{
Engine = new Salience(licensePath, dataPath);
}
catch (SalienceException e)
{
System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
return;
}
int nRet = Engine.PrepareText("Lexalytics is headquartered in Amherst, MA");
if (nRet==0)
{
List<SalienceTheme> myThemes = Engine.GetDocumentThemes(String.Empty);
foreach (SalienceTheme aTheme in myThemes)
{
....
}
}
Salience.GetDocumentIntentions
Summary
Returns a list of intentions identified within the document content.
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 lxaGetIntentions.
Syntax
public List<SalienceIntention> GetDocumentIntentions(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, a List<> of SalienceIntention objects is returned. Otherwise, an exception is thrown with information about the failure.
Back to top
Salience.GetQueryDefinedTopics
Summary
Returns the topics determined for the text 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 lxaGetQueryDefinedTopics.
Syntax
public List<SalienceTopic> GetQueryDefinedTopics(String id="")
Parameters
| 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
List<SalienceTopic> topics = GetQueryDefinedTopics(id="")
Salience.GetConceptDefinedTopics
Summary
Returns the topics determined for the text 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 lxaGetConceptDefinedTopics.
Syntax
public List<SalienceTopic> GetConceptDefinedTopics(String id="")
Parameters
| 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
List<SalienceTopic> topics = GetConceptDefinedTopics(id="")
Salience.ExplainConceptMatches
Summary
Returns a formatted block of text listing the concept topics determined for the text via the Salience 6 Concept Matrix, as well as individual terms that occur in the text that generate the matches. Before calling this method, you must specify a concept topic list using the Concept Topic List option.
This method has a longer execution time than the call to GetConceptDefinedTopics and should be reserved for use in diagnostic or research interfaces or other application areas where a longer execution time is feasible.
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 lxaExplainConceptMatches.
Syntax
public string ExplainConceptMatches(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, string containing a formatted block of text is returned. Each line in the text string returned contains either a topic label and overall match score or (indented) a document term contributing to the match for a certain topic and the term match score. Otherwise, an exception is thrown with information about the failure.
Example
string returnvalue = ExplainConceptMatches();
Salience.GetDocumentCategories
Summary
This method returns the categories for a document based on a predefined set of categories, which has been extracted from Wikipedia content classification into a wide spectrum of categories. Customers have the ability to tune the category set through datafiles, allowing certain categories to be excluded from consideration, or tuning other categories through additional terms. Categories are returned as a list of SalienceTopic structures.
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 lxaGetDocumentCategories.
Syntax
public List<SalienceTopic> GetDocumentCategories(String id="")
Parameters
| 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
List<SalienceTopic> topics = new List<SalienceTopic>()
topics = GetDocumentCategories();
Salience.GetDocumentClasses
Summary
Retrieves the classifications for a document based on the provided classification model.
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 lxaGetDocumentClasses.
Syntax
public List<SalienceTopic> GetDocumentClasses(String modelPath, String id="")
Parameters
| The path to a classification model to use. |
---|---|
| 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
Salience.GetNamedEntities
Summary
Performs entity extraction on the document. The entities returned are those determined on the basis of the entity extraction model provided with Salience 6. It also returns entities defined by any customer-defined list (CDL) files or pattern (PTN) files used to augment out-of-the-box entity extraction.
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 lxaGetNamedEntities.
Syntax
public List<SalienceEntity> GetNamedEntities(String id="")
public List<SalienceEntity> GetNamedEntities(SalienceEntityParams Params, String id="")
Parameters
| A SalienceEntityParams object containing parameters for entity extraction |
---|---|
| Optional: The identifier for a specific configuration for results. |
Returns
If successful, returns a List<> of SalienceEntity objects containing information about the entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetNamedEntityRelationships
Summary
Gets the relationships between entities within the text.
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 lxaGetNamedEntityRelationships.
Syntax
public List<SalienceRelationship> GetNamedEntityRelationships(int nThreshold, String id="")
Parameters
| The required threshold for entities for which relationships should be extract |
---|---|
| Optional: The identifier for a specific configuration for results. |
Returns
If successful, returns a List<> of SalienceRelationship objects containing information about the relationships between entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetNamedEntityOpinions
Summary
Gets the opinions expressed by entities within the text.
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 lxaGetNamedEntityOpinions.
Syntax
public List<SalienceOpinion> GetNamedEntityOpinions(int nThreshold, String id="")
Parameters
| The required threshold for entities for which opinions should be extract |
---|---|
| Optional: The identifier for a specific configuration for results. |
Returns
If successful, returns a List<> of SalienceOpinion objects containing information about the opinions expressed by entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetUserDefinedEntities
Summary
Performs extraction of user-defined entities on the document. The entities returned are only those specified by the user through the User Entity List option, which must be set before this API 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 lxaGetUserDefinedEntities.
Syntax
public List<SalienceEntity> GetUserDefinedEntities(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns a List<> of SalienceEntity objects containing information about the user-defined entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetUserEntityRelationships
Summary
Gets the relationships between user-defined entities within the text. These entities are only those specified by the user through the User Entity List option, which must be set before this API 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 lxaGetUserEntityRelationships.
Syntax
public List<SalienceRelationship> GetUserEntityRelationships(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns a List<> of SalienceRelationship objects containing information about the relationships between user-defined entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetUserEntityOpinions
Summary
Gets the opinions expressed by user-defined entities within the text. These entities are only those specified by the user through the User Entity List option, which must be set before this API 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 lxaGetUserEntityOpinions.
Syntax
public List<SalienceOpinion> GetUserEntityOpinions(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns a List<> of SalienceOpinion objects containing information about the opinions expressed by user-defined entities extracted from the content. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetEntityTaggedText
Summary
Returns the text marked up with named entities identified by Salience 6.
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 lxaGetNamedEntityMarkup.
Syntax
public string GetEntityTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with named entities indicated by markup tags. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetUserEntityTaggedText
Summary
Returns the text marked up with user-defined entities identified by Salience 6.
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 lxaGetUserEntityMarkup.
Syntax
public string GetUserEntityTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with user-defined entities indicated by markup tags. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetPOSTaggedText
Summary
Returns the text marked up with the part-of-speech (POS) tag identified for each token within the text. This is helpful for investigating issues with results that may be caused by inaccurate part-of-speech tagging.
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 lxaGetPOSMarkup.
Syntax
public string GetPOSTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with part-of-speech tags applied to all tokens. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetSentimentTaggedText
Summary
Returns the text marked up with identification of sentiment-bearing phrases used for sentiment analysis for the content.
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 lxaGetSentimentMarkup.
Syntax
public string GetSentimentTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with sentiment-bearing phrases indicated by markup tags. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetNamedOpinionTaggedText
Summary
Returns the text marked up with the opinions extracted for named entities identified by Salience 6.
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 lxaGetNamedOpinionTaggedText.
Syntax
public string GetNamedOpinionTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with the opinions attributed to named entities indicated by markup tags. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Salience.GetUserOpinionTaggedText
Summary
Returns the text marked up with the opinions extracted for user-defined entities identified by Salience 6.
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 lxaGetUserOpinionTaggedText.
Syntax
public string GetUserOpinionTaggedText(String id="")
Parameters
| Optional: The identifier for a specific configuration for results. |
---|
Returns
If successful, returns string containing the document text with the opinions attributed to user-defined entities indicated by markup tags. Otherwise, an exception is thrown with information about the failure.
Example
TODO: Example needed for Salience 6
Updated 6 months ago