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


Returns the topics determined for the collection via user-defined queries. Before calling this method, you must specify the topic list using the Topic List option.
This method provides a wrapper around the underlying C API method lxaGetCollectionQueryDefinedTopics.


salience6.getCollectionQueryDefinedTopics(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 query matches
type 0 (indicates query 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.getCollectionQueryDefinedTopics(session, "")
        for topic in topics:
            print topic["topic"], topic["hits"]
        if (ret==6):
            print se6.getLastWarnings(session) 

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