getSummary

<< getDocumentDetails | Back to Salience 6 python Index | getDocumentSentiment >>

Summary

Returns a structure of summary information for the current text. The 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.
This method provides a wrapper around the underlying C API method lxaGetSummary.

Syntax

salience6.getSummary(oSession, nLength, acConfigurationID)

Parameters

oSession A SalienceSession object previously created via openSession
nLength Maximum number of sentences for the summary
acConfigurationID An identifier for a configuration added through addConfiguration, or empty string for default configuration

Returns

If successful, returns a Python dictionary containing with the following keys:
summary The default summary of the document
sentences Information for the individual sentences in the default summary, including ranking of importance in the summary
alternate_summary An alternate summary of the document
alternate_sentences Information for the individual sentences in the alternate summary, including ranking of importance in the summary

Example

    import salience6 as se6
    session = se6.openSession('/path/to/license.v5','/path/to/data')
    ret = se6.prepareTextFromFile(session,'/path/to/aFile.txt')
    if (ret==0):
        summary = se6.getSummary(session, 3, "")
        print summary.
    else:
        if (ret==6):
            print se6.getLastWarnings(session) 
    se6.closeSession(session)

<< getDocumentDetails | Back to Salience 6 python Index | getDocumentSentiment >>