getCollectionUserEntities

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

Summary

Returns the user-defined entities from the collection. This is based on the entity list specified through the User Entity List option. Other adjustments can be made through the available Collection Options, which must be set before this call is made.
This method provides a wrapper around the underlying C API method lxaGetCollectionUserEntities.

Syntax

salience6.getCollectionUserEntities(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:
normalized The normalized form for the entity
type The entity type (Person, Place, Company, Product, etc.)
label A descriptive label for the entity
hits The number of occurrences of the entity within the collection
positive_hits The occurrences of the entity within the collection associated with positive sentiment
negative_hits The occurrences of the entity within the collection associated with negative sentiment
neutral_hits The occurrences of the entity within the collection associated with neutral sentiment
mentions A list of structures containing information about occurrences of the entity

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):
        entities = se6.getCollectionUserEntities(session, "")
        for entity in entities:
            print entity["normalized"], entity["type"], entity["hits"]
    else:
        if (ret==6):
            print se6.getLastWarnings(session) 
    se6.closeSession(session)

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