Personas

POST https://apiv2.indico.io/personality?persona=true
Predicts the Myers Briggs persona of an author based on a sample of text.

Current Version: 1

Private cloud endpoint

POST https://[cloud].indico.domains/personality/[batch]/?persona=true

Arguments

data – String | List – required – text to be analyzed
[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
For an example of how to pass keyword arguments to the indico API in a post request, see the right hand sidebar.

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

// Single Example
fetch('https://apiv2.indico.io/personality', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: 'I only stay home on Saturday nights to read.',
    persona: true,
    threshold: 0.1
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/personality/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      'I only stay home on Saturday nights to read.', 
      'I just want to support my friends and always be there for them.'
    ],
    persona: true,
    threshold: 0.1
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));