<< getUserEntityOpinions | Back to Salience 6 python Index | getCollectionFacets >>


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.
This method provides a wrapper around the underlying C API method lxaGetCollectionThemes.


salience6.getCollectionThemes(oSession, acConfigurationID)


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


If successful, returns a Python list of theme items containing the following information:
theme The text of the theme
stemmed_theme The stemmed version of the theme
normalized_theme The normalized version of the theme
theme_type 2 (indicates collection theme)
score The number of themes rolled up into this theme
sentiment A sentiment score derived by aggregating the sentences from collection documents that contain the theme into a single document
evidence The number of sentiment phrases used in determining sentiment score above
about Not used for collection themes
summary Not used for collection themes


    import salience6 as se6
    session = se6.openSession('/path/to/license.v5','/path/to/data')
    ret = se6.prepareCollectionFromFile(session,'myCollection','/path/to/aFile.txt')
    if (ret==0):
        themes = se6.getCollectionThemes(session, "")
        for theme in themes:
            print theme["theme"], theme["sentiment"]
        if (ret==6):
            print se6.getLastWarnings(session) 

<< getUserEntityOpinions | Back to Salience 6 python Index | getCollectionFacets >>