getCollectionConceptDefinedTopics

<< getCollectionQueryDefinedTopics | Back to Salience 6 python Index | getCollectionEntities >>

Summary

Returns the topics determined for the collection via the Salience 6 Concept Matrix. Before calling this method, you must specify a concept topic list using the Concept Topic List option.
This method provides a wrapper around the underlying C API method lxaGetCollectionConceptDefinedTopics.

Syntax

salience6.getCollectionConceptDefinedTopics(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 of items containing the following information about topics:
topic The label for the topic
hits The number of documents in the collection with hits for the query topic
score 0 (not used)
sentiment An average of the sentiment values for topic hits within the collection
documents A list of collection document IDs containing concept topic match
type 1 (indicates concept topic result)

Example

    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):
        topics = se6.getCollectionConceptDefinedTopics(session, "")
        for topic in topics:
            print topic["topic"], topic["hits"], topic["score"]
    else:
        if (ret==6):
            print se6.getLastWarnings(session) 
    se6.closeSession(session)

<< getCollectionQueryDefinedTopics | Back to Salience 6 python Index | getCollectionEntities >>