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


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.


salience6.getCollectionConceptDefinedTopics(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 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)


    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"]
        if (ret==6):
            print se6.getLastWarnings(session) 

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