getConceptDefinedTopics

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

Summary

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.

Syntax

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

Example

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

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