Keywords

The Keywords V2 API has been removed as of Nov. 1st, 2018.

POST https://apiv2.indico.io/keywords?version=[version]
Identify the important words within a document.

Current Version: 4

Private cloud endpoint

POST https://[cloud].indico.domains/keywords/[batch]/?version=[version]

Arguments

data – String | List – required – text to be analyzed
[v or version] – Integer – optional (defaults to 4) – 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 will return a dictionary with top_n key-value pairs. These key-value pairs represent the likelihood that each of the extracted keywords are relevant to the analyzed text. The keys in the dictionary are strings containing the extracted keywords, and the values are the likelihoods that these keywords are relevant to the analyzed text.

# single output
{
  'state': 0.38810469246709006,
  'sunshine': 0.61189530753291
}

# batch output
[
  {
      'state': 0.38810469246709006,
      'sunshine': 0.61189530753291
  },
  {
      'state': 0.38810469246709006,
      'sunshine': 0.61189530753291
  }
]

Example

// Single Example
fetch('https://apiv2.indico.io/keywords?version=2', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: 'Some call it the sunshine state',
    threshold: 0.1
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/keywords/batch?version=2', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      'Some call it the sunshine state',
      'Some call it the sunshine state'
    ],
    threshold: 0.1
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));