Entity

API reference for functions relating to getting information on entity detection and relationship extraction from a document analysis.

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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (called *pSession here) has already been opened with 
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceEntityList oEntityList;

    lxaPrepareTextFromFile(pSession, acPath);
    lxaGetNamedEntities(pSession, &oEntityList);

    /* Result found in oEntityList. Clear this resource when finished
        by using lxaFreeEntityList. */

    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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (Called *pSession here) has already been opened with 
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceRelationList oRelationships;

    lxaPrepareTextFromFile(pSession, acPath);

    // Leave argument acConfigurationID blank to use default configuration
    lxaGetNamedEntityRelationships(pSession, &oRelationships);

    /* Result found in oRelationships. Clear this resource when finished
        by using lxaFreeRelationList. */

    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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (called *pSession here) has already been opened with 
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceOpinionList oOpinionList;
    char *acConfigId = "";

    lxaPrepareTextFromFile(pSession, acPath);
    lxaGetNamedEntityOpinions(pSession, &oOpinionList, acConfigId);
    
    /* Result found in oOpinionList. Clear this resource when finished
        by using lxaFreeOpinionList. */
    
    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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (called *pSession here) has already been opened with
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceEntityList oEntityList;
    char *acConfigId = "";

    lxaPrepareTextFromFile(pSession, acPath);
    lxaGetUserDefinedEntities(pSession, &oEntityList, acConfigId);

    /* Result found in oOpinionList. Clear this resource when finished
        by using lxaFreeOpinionList. */

    lxaFreeOpinionList(&oOpinionList);

    // ...

    lxaCloseSalienceSession(pSession);

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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (Called *pSession here) has already been opened with
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceRelationList oRelationships;

    lxaPrepareTextFromFile(pSession, acPath);

    // Leave argument acConfigurationID blank to use default configuration
    lxaGetUserEntityRelationships(pSession, &oRelationships);

    /* Result found in oRelationships. Clear this resource when finished
        by using lxaFreeRelationList. */

    lxaFreeRelationList(&oRelationships);

    // ...

    lxaCloseSalienceSession(pSession);

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.

Returns: Integer return code. To retrieve more information on the return code use lxaGetLastWarnings on the SalienceSession structure.

More information on errors and warnings can be found in the Errors and Warning Codes section of our documentation.

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

Parameter

Description

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

Example:
Use lxaLoadLicense to create LexalyticsLicense structure. This will then be given to lxaOpenSalienceSession, which is then used to start a session with Salience.

/* Assuming a SalienceSession (called *pSession here) has already been opened with
    a valid LexalyticsLicense */

    char *acPath = "c:/somefile.txt";
    SalienceOpinionList oOpinionList;
    char *acConfigId = "";

    lxaPrepareTextFromFile(pSession, acPath);
    lxaGetUserOpinions(pSession, &oOpinionList, acConfigId);

    /* Result found in oOpinionList. Clear this resource when finished
        by using lxaFreeOpinionList. */

    lxaFreeOpinionList(&oOpinionList);

    // ...

    lxaCloseSalienceSession(pSession);