Personas

personas(data, [api_key], [cloud], [top_n], [threshold])
Predicts the Myers Briggs persona of an author based on a sample of text.

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
[top_n] – Integer – optional (defaults to 3) – only return this many of the most likely topics
[threshold] – Float – optional (defaults to .0) – only return topics with likelihood greater than this number

Output

This function returns a dictionary that maps from the 16 Myers Briggs personas to the probability that the author aligns with the respective persona.

# single output
{
    'advocate': 0.03894013672918785,
    'debator': 0.038705012628395506,
    'mediator': 0.036483237448904055,
    ... 12 personas omitted ...,
    'consul': 0.12134217481571341
}

# batch output
[
    {
        'advocate': 0.03894013672918785,
        'debator': 0.038705012628395506,
        'mediator': 0.036483237448904055,
        ... 12 personas omitted ...,
        'consul': 0.12134217481571341
    },
    {
        'advocate': 0.06534374748375202,
        'debator': 0.0395961902984347,
        'mediator': 0.06496332439207353,
        ... 12 personas omitted ...,
        'consul': 0.10546097577494343
    }
]

Example

import indicoio
indicoio.config.api_key = 'YOUR_API_KEY'

# single example
indicoio.personas("I only stay home on Saturday nights to read.")

# batch example
indicoio.personas([
    "I only stay home on Saturday nights to read.",
    "I just want to support my friends and always be there for them."
])