Summarization

POST https://apiv2.indico.io/summarization
Predicts the emotion expressed by an author in a sample of text.

Current Version: 1

Private cloud endpoint

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

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 relevant sentences

For an example of how to pass keyword arguments to the indico API in a post request, see the example below.

Output

This function returns a list of the most representative sentences from the input document.

# single output
[
  "Even the most well-intentioned gift givers don't always give their friends and loved ones what they really want.",
  "This scenario will sound familiar to most people.",
  "Say you've put a lot of time and effort into finding a gift for your significant other.",
  "Gift recipients are more happy with requested gifts because they are the things that they actually want.",
  "But givers aren't all to blame here."
]

# batch output
[
  [
    "Even the most well-intentioned gift givers don't always give their friends and loved ones what they really want.",
    "This scenario will sound familiar to most people.",
    "Say you've put a lot of time and effort into finding a gift for your significant other.",
    "Gift recipients are more happy with requested gifts because they are the things that they actually want.",
    "But givers aren't all to blame here."
  ],
  [
    "Well, your loss.",
    "Or, more accurately, their loss, since it turns out that we're pretty reliably terrible gift-givers.",
    "The reason why, according to a a new study in the Journal of Consumer Research, is that those of us giving gifts are too wrapped up in sentimentality to buy anything of much use for our loved ones.",
    "Ironically, the study finds that we're awful gift-givers precisely because we spend too much time trying to be considerate.",
    "We imagine our friends opening a gift that is impressive, expensive, and sentimental."
  ]
]

Example

// Single Example
fetch('https://apiv2.indico.io/summarization', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: 'http://www.cnn.com/2016/12/16/health/psychology-of-gift-giving/index.html',
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/summarization/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      'http://www.cnn.com/2016/12/16/health/psychology-of-gift-giving/index.html', 
      'http://www.theatlantic.com/business/archive/2014/03/why-youre-bad-at-giving-gifts/284592/'
    ],
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));