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


Returns the topics determined for the text 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 lxaGetConceptDefinedTopics.


salience6.getConceptDefinedTopics(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 consisting of items that contain the following information about a topic:
topic The label for the topic
hits 0 (this field is not used)
score 'Strength of the concept topic match to document content
sentiment Sentiment for content related to the topic within the document
summary Summary of content related to topic
type 1 (indicates concept topic result)


    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):
        se6.setOption_ConceptTopicList(session, '/path/to/queries.txt')
        topics = se6.getConceptDefinedTopics(session, "")
        for topic in topics:
            print topic["topic"], topic["score"]
        if (ret==6):
            print se6.getLastWarnings(session) 

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