Organizations

POST https://apiv2.indico.io/organizations
Identify references to specific organizations found in a document.

Current Version: 2

Private cloud endpoint

POST https://[cloud].indico.domains/organizations/[batch]/

Arguments

data – String | List – required – text to be analyzed
[v or version] – Integer – optional (defaults to 2) – specify model version
[threshold] – Float (defaults to 0.01) – optional – only return named entities 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 example below.

Output

This function will return a list of dictionaries of three key-value pairs. Each dictionary represents a substring from the input document that the model has predicted is an organization, with confidence greater than your threshold. Each dictionary has three keys: text, confidence, and position. The text key maps to a substring from the document that is predicted to be an organization. The confidence key maps to a float between 0 and 1, representing how confident the model is that the text is an organization. The position key maps to a two element list with the start character position and end character position of text in the input document.

# single output
[
    {
        'text': 'London Underground',
        'confidence':  0.913224,
        'position':  [0, 18]
    }
]

# batch output
[
    [
        {
            'text': 'London Underground',
            'confidence':  0.913224,
            'position':  [0, 18]
        }
    ],
    [
        {
            'text': 'London Underground',
            'confidence':  0.913224,
            'position':  [0, 18]
        }
    ]
]

Example

// Single Example
fetch('https://apiv2.indico.io/organizations', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: "London Underground's boss Mike Brown warned that the strike ...",
    threshold: 0.01
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/organizations/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      "London Underground's boss Mike Brown warned that the strike ...",
      "London Underground's boss Mike Brown warned that the strike ..."
    ],
    threshold: 0.01
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));