Personality

personality.predict(data, [params])
Predicts the personality traits of a text’s author.

Current Version: 1

Arguments

data – String | List – required – text to be analyzed
[api_key] – String – optional – your indico API key
[cloud] – String – optional – your private cloud subdomain
[v or version] – Integer – optional (defaults to 1) – specify model version

Output

This function returns a dictionary that maps the following personality traits to their likelihood of describing the author: extraversion, openness, agreeableness, conscientiousness. These values are independent, meaning the probabilities don’t effect each other. For example, somebody could score 0.9 (90%) on extraversion and 0.86 (86%) on openness.

# single output
{
    'extraversion': 0.384...,
    'openness': 0.730...,
    'agreeableness': 0.439...,
    'conscientiousness': 0.103...
}

# batch output
[
    {
        'extraversion': 0.384...,
        'openness': 0.730...,
        'agreeableness': 0.439...,
        'conscientiousness': 0.103...
    }, 
    {
        'extraversion': 0.384...,
        'openness': 0.730...,
        'agreeableness': 0.439...,
        'conscientiousness': 0.103...
    }
]

Example

import java.io.File;
import java.util.List;
import java.util.Map;
import io.indico.Indico;
import io.indico.api.text.Personality;

// single example
Indico indico = new Indico("YOUR_API_KEY");
Map results = indico.personality.predict("I love my friends").getPersonality();
System.out.println(results);

// batch example
String[] example = {
    I love my friends., 
    I love my friends.
};
List> batchResults = indico.personality.predict(example).getPersonality();
System.out.println(batchResults);