Relevance

Relevance V1 will be removed on April 15th, 2019. Relevance V2 is now available.

POST https://apiv2.indico.io/relevance
Convert text into meaningful feature vectors.
Extracts abstract text features for use as inputs to learning algorithms.

Current Version: 1

Private cloud endpoint

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

Arguments

data – String | List – required – text to be analyzed
queries – String | List – required – a list of queries to run against the document
[v or version] – Integer – optional (defaults to 1) – specify model version

Output

This function returns a list of floating point values representing the relevance of a given search query to the provided document or documents. The `data` argument and the `queries` argument may be either a single text string or a list of text strings.

# single output
[0.6740826540660497, 0.16670130847921036]

# batch output
[
    [0.16670130847921036],
    [0.2949661163493879]
]

Example

// Single Example
fetch('https://apiv2.indico.io/relevance', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: 'Renowned soccer legend Pele will be visiting...',
    queries: ['team sports', 'royalty']
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/relevance/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: ['Renowned soccer legend Pele will be visiting...', 'The Queen of England will be visiting...'],
    queries: ['royalty']
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));