lxaGetCollectionDetails
Summary
Retrieves information about the collection. At present, the SalienceCollectionDetails contains only the number of documents in the collection.
Syntax
int lxaGetCollectionDetails(SalienceSession *pSession,
SalienceCollectionDetails *pDetails,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to aSalienceCollectionDetails structure that will get filled in by the call |
| Character string specifying the configuration for the results, blank for the default configuration |
Returns
This function returns an integer return code.
Example
TODO: Provide example for Salience 6
lxaGetCollectionThemes
Summary
Retrieves the 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 acConfigurationID
parameter specifies the configuration for the results, which are returned in a SalienceThemeList structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the allocated memory by calling lxaFreeThemeList.
Syntax
int lxaGetCollectionThemes(SalienceSession *pSession,
SalienceThemeList *pResult,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceThemeList structure that will get filled in by the call |
| 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
lxaGetCollectionFacets
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 acConfigurationID
parameter specifies the configuration for the results, which are returned in a SalienceFacetList structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the allocated memory by calling lxaFreeFacetList.
Syntax
int lxaGetCollectionFacets(SalienceSession *pSession,
SalienceFacetList *pResults,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceFacetList structure that will get filled in by the call |
| 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
lxaGetCollectionQueryDefinedTopics
Summary
Retrieves 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 acConfigurationID
parameter specifies the configuration for the results, which are returned in a SalienceTopicList structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the allocated memory by calling lxaFreeTopicList.
Syntax
int lxaGetCollectionQueryDefinedTopics(SalienceSession *pSession,
SalienceTopicList *pResult,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceTopicList structure |
| Character string specifying the configuration for the results, blank for the default configuration |
Returns
This function returns an integer return code.
lxaGetCollectionConceptDefinedTopics
Summary
Retrieves 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.
Sets the pEntities member of the passed in SalienceCollectionEntityList to point to an array of SalienceCollectionEntity 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 lxaFreeCollectionEntityList.
Syntax
int lxaGetCollectionEntities(SalienceSession *pSession,
SalienceCollectionEntityList *pResults,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceCollectionEntityList structure that will get filled in by the call |
| Character string specifying the configuration for the results, blank for the default configuration |
Returns
| Entity extraction completed successfully. |
---|---|
| There was a non-fatal issue with entity extraction. Use lxaGetLastWarnings to determine the cause of the warning. |
Example
TODO: Example needed for Salience 6
lxaGetCollectionEntities
Summary
Retrieves 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.
Sets the pEntities member of the passed in SalienceCollectionEntityList to point to an array of SalienceCollectionEntity 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 lxaFreeCollectionEntityList.
Syntax
int lxaGetCollectionUserEntities(SalienceSession *pSession,
SalienceCollectionEntityList *pResults,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceCollectionEntityList structure that will get filled in by the call |
| Character string specifying the configuration for the results, blank for the default configuration |
Returns
| Entity extraction completed successfully. |
---|---|
| There was a non-fatal issue with entity extraction. Use lxaGetLastWarnings to determine the cause of the warning. |
Example
TODO: Example needed for Salience 6
lxaGetCollectionUserEntities
Summary
Provides a structured representation of the document with annotation of entities identified within the text. The SalienceDocument structure contains a set of SalienceSentence structures, which contain SalienceWord structures that contain information about the entities within the document.
The acConfigurationID
parameter specifies the configuration for the results. Configurations are defined using the method lxaAddSalienceConfiguration.
After use, you should free allocated memory by calling lxaFreeDocument.
Syntax
int lxaGetNamedEntityMarkup(SalienceSession *pSession,
SalienceDocument *pDocument,
const char *acConfigurationID);
Parameters
| Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession |
---|---|
| Pointer to a SalienceDocument structure that will get filled in by the call |
| Character string specifying the configuration for the results, blank for the default configuration |
Returns
This method returns an integer return code.
Example
std::string sMarkup = "";
int nPrimaryId = -1;
int nSecondaryId = -1;
std::string sType = "";
SalienceDocument oDocument;
lxaGetNamedEntityMarkup(pSession,&oDocument);
for(size_t i = 0; i < oDocument.nSentenceCount; i++)
{
for(size_t j = 0; j < oDocument.pSentences[i].nLength; j++)
{
if(oDocument.pSentences[i].pTokens[j].nId == -1)
{
if(nPrimaryId != -1)
{
sMarkup += "</";
sMarkup += sType;
sMarkup += ">";
nPrimaryId = -1;
nSecondaryId = -1;
}
if(oDocument.pSentences[i].pTokens[j].nPostFixed == 0)
{
sMarkup += " ";
}
sMarkup += oDocument.pSentences[i].pTokens[j].acToken;
}
else
{
if(nPrimaryId == oDocument.pSentences[i].pTokens[j].nId &&
nSecondaryId == oDocument.pSentences[i].pTokens[j].nSecondaryId)
{
if(oDocument.pSentences[i].pTokens[j].nPostFixed == 0)
{
sMarkup += " ";
}
sMarkup += oDocument.pSentences[i].pTokens[j].acToken;
}
else
{
if(nPrimaryId != -1)
{
sMarkup += "</";
sMarkup += sType;
sMarkup += ">";
}
if(oDocument.pSentences[i].pTokens[j].nPostFixed == 0)
{
sMarkup += " ";
}
nPrimaryId = oDocument.pSentences[i].pTokens[j].nId;
nSecondaryId = oDocument.pSentences[i].pTokens[j].nSecondaryId;
sType = oDocument.pSentences[i].pTokens[j].acEntityType;
sMarkup += "<";
sMarkup += sType;
sMarkup += ">";
sMarkup += oDocument.pSentences[i].pTokens[j].acToken;
}
}
}
}
if(nPrimaryId != -1)
{
sMarkup += "</";
sMarkup += sType;
sMarkup += ">";
nPrimaryId = -1;
nSecondaryId = -1;
}
std::cout << sMarkup << std::endl;
lxaFreeDocument(&oDocument);
Updated 12 months ago