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

lxaGetNamedEntities

Summary

Retrieves the entities from text based on model-based or datafile-based entity extraction. Parameters to control entity extraction should be specified by setting Entity Options.

The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceEntityList structure. Configurations are defined using the method lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeEntityList.

Syntax

int lxaGetNamedEntities(SalienceSession *pSession, 
                        SalienceEntityList *pResults,
                        const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession.

pResults

Pointer to a SalienceEntityList structure

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

LXA_OK

Entity extraction completed successfully.

LXA_OK_WITH_WARNINGS

There was a non-fatal issue with entity extraction. Use lxaGetLastWarnings to determine the cause of the warning.

Example

char* acPath = "c:/somefile.txt";
        SalienceEntityList oEntityList;
        SalienceEntityParams oParams;
        SalienceSession* pSession;
        ... //Set up the parameters as well as the license here
        if (lxaOpenSalienceSession(oLicense,acDataPath,&pSession,&acError) == LXA_OK)
        {
            lxaPrepareTextFromFile(pSession,acPath);
            lxaGetNamedEntities(pSession,&oEntityList);
            ...
            lxaFreeEntityList(&oEntityList);
            lxaCloseSalienceSession(pSession);
        }

lxaGetNamedEntityRelationships

Summary

Retrieves the relationships between entities within the text.

The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceRelationList structure. Configurations are defined using the method lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeRelationList.

Syntax

int lxaGetNamedEntityRelationships(SalienceSession *pSession, 
                                   SalienceRelationList *pResults,
                                   const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession

pResults

Pointer to a SalienceRelationList structure

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

char* acPath = "c:/somefile.txt";
        SalienceRelationList oRelationships;
        SalienceSession* pSession;
        char* acConfigId = "";
        ...
        if (lxaOpenSalienceSession(oLicense,acDataPath,&pSession,&acError) == LXA_OK)
        {
            lxaPrepareTextFromFile(pSession,acPath);
            lxaGetNamedEntityRelationships(pSession,&oRelationships,acConfigId);
            ...
            lxaFreeRelationList(&oRelationships);
            lxaCloseSalienceSession(pSession);
        }

lxaGetNamedEntityOpinions

Summary

Retrieves the opinions expressed by entities within the text.

The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceOpinionList structure. Configurations are defined using the method lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeOpinionList.

Syntax

int lxaGetNamedEntityOpinions(SalienceSession *pSession, 
                              SalienceOpinionList *pResults,
                              const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession

pResults

Pointer to a SalienceOpinionList structure

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

char* acPath = "c:/somefile.txt";
        SalienceOpinionList oOpinionList;
        SalienceSession* pSession;
        char* acConfigId = "";
        ... //Set up the parameters as well as the license here
        if (lxaOpenSalienceSession(oLicense,acDataPath,&pSession,&acError) == LXA_OK)
        {
            lxaPrepareTextFromFile(pSession,acPath);
            lxaGetNamedEntityOpinions(pSession,&oOpinionList,acConfigId);
            ...
            lxaFreeOpinionList(&oOpinionList);
            lxaCloseSalienceSession(pSession);
        }

lxaGetUserDefinedEntities

Summary

Retrieves the user-defined entities from text. This is based on the entity list specified through the User Entity List option. Other parameters to control entity extraction should be specified by setting additional Entity Options. These options must be set before calling this method.

The method sets the pEntities member of the passed in SalienceEntityList to point to an array of SalienceEntity structures. The nLength member is set to the length of this array

The acConfigurationID parameter specifies the configuration for the results. Configurations are defined using the method lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeEntityList.

Syntax

int lxaGetUserDefinedEntities(SalienceSession *pSession, 
                              SalienceEntityList *pResults,
                              const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession

pResults

Pointer to a SalienceEntityList structure that will get filled in by the call

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

TODO: Update example needed for Salience 6

lxaGetUserEntityRelationships

Summary

Retrieves the relationships between user-defined entities within the text. User-defined entities are based on the entity list specified through the User Entity List option. Other parameters to control entity extraction should be specified by setting additional Entity Options. These options must be set before calling this method.

This function sets the pResults member of the passed in SalienceRelationList to point to an array of SalienceRelation structures. The nLength member is set to the length of this array.

The acConfigurationID parameter specifies the configuration for the results. Configurations are defined using the method [lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeRelationList.

Syntax

int lxaGetUserEntityRelationships(SalienceSession *pSession, 
                                  SalienceRelationList *pResults,
                                  const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession

pResults

Pointer to a SalienceRelationList structure that will get filled in by the call

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

TODO: Example needed for Salience 6

lxaGetUserEntityOpinions

Summary

Retrieves the opinions expressed by user-defined entities within the text. User-defined entities are based on the entity list specified through the User Entity List option. Other parameters to control entity extraction should be specified by setting additional Entity Options. These options must be set before calling this method.

This function sets the pResults member of the passed in SalienceOpinionList to point to an array of SalienceOpinion structures. The nLength member is set to the length of this array.

The acConfigurationID parameter specifies the configuration for the results. Configurations are defined using the method lxaAddSalienceConfiguration.

After use you should free the allocated memory by calling lxaFreeOpinionList.

Syntax

int lxaGetUserEntityOpinions(SalienceSession *pSession, 
                             SalienceOpinionList *pResults,
                             const char *acConfigurationID);

Parameters

pSession

Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession

pResults

Pointer to a SalienceOpinionList structure that will get filled in by the call

acConfigurationID

Character string specifying the configuration for the results, blank for the default configuration

Returns

This method returns an integer return code.

Example

TODO: Example needed for Salience 6

Updated 7 months ago

Entity


Suggested Edits are limited on API Reference Pages

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