getDocumentThemes

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

Summary

Returns the themes of the text. This method provides a wrapper around the underlying C API method lxaGetThemes.

Syntax

salience6.getDocumentThemes(oSession, acConfigurationID)

Parameters

oSession A SalienceSession object previously created via openSession
acConfigurationID An identifier for a configuration added through addConfiguration, or empty string for default configuration

Returns

If successful, returns a Python list consisting of items that contain the following information about a theme:
theme The text of the theme
stemmed_theme The stemmed version of the theme
normalized_theme The normalized version of the theme
theme_type An indicator is this is a "meta-theme" (1) or not (0)
score A measure of the strength of the theme within the document
sentiment The sentiment score for the theme
evidence A measure (from 1 to 7) of the content on which the sentiment score for the theme is based
about An indicator specifying if the theme is contained within the summary of the document
summary A summary of the document content relevant to the theme

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):
        themes = se6.getDocumentThemes(session, "")
        for theme in themes:
            print theme["theme"], theme["score"]
    else:
        if (ret==6):
            print se6.getLastWarnings(session) 
    se5.closeSession(session)

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