lxaGetSummary

<< lxaGetDocumentDetails | Back to Salience 6 C API Index | lxaGetSentiment >>

Summary

Retrieves summary information for the current text. The SalienceSummaryResult structure provides a default summary and an alternate summary, as well as ranking for the sentences in the summary.
The default summary method determines the most significant fragments in the document, and extracts the first sentence from those fragments. The alternate method extracts sentences that connect the most fragments.
The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceSummaryResult structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the result structure using lxaFreeSummaryResult.

Syntax

int lxaGetSummary(SalienceSession *pSession,
                  int nLength, 
                  SalienceSummaryResult *pResult,
                  const char *acConfigurationID);

Parameters

pSession Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession
nLength Length, in number of sentences, of the summary you want returned
pResult Pointer to a SalienceSummaryResult structure
acConfigurationID Character string specifying the configuration for the results, blank for the default configuration

Returns

This function returns an integer return code.

Example

     char* acPath = "/path/to/content";
     SalienceSummaryResult oSummary;
     ...
     SalienceSession* pSession;
     if(lxaOpenSalienceSession(oLicense, &oStartup, &pSession) != LXA_OK)
          return 1;
     lxaPrepareTextFromFile(pSession,acPath);
     lxaGetSummary(pSession,4,&oSummary);
     std::cout << "Summary: " << oSummary.acSummary << std::endl;
     std::cout << "Alternate summary: " << oSummary.acAlternateSummary << std::endl;
     lxaFreeSummaryResult(oSummary);
     lxaCloseSalienceSession(pSession);

<< lxaGetDocumentDetails | Back to Salience 6 C API Index | lxaGetSentiment >>