Summarization

summarization.predict(data, [params])
Predicts the emotion expressed by an author in a sample of text.

Current Version: 1

Arguments

data – String | List – required – text to be analyzed
[api_key] – String – optional – your indico API key
[cloud] – String – optional – your private cloud subdomain
[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

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

import io.indico.Indico;
import io.indico.api.IndicoResult;
import io.indico.api.BatchIndicoResult;

// single example
Indico indico = new Indico("YOUR_API_KEY");
IndicoResult single = indico.summarization.predict(
    "http://www.cnn.com/2016/12/16/health/psychology-of-gift-giving/index.html"
);
List result = single.getSummary();
System.out.println(result);

// batch example
String[] example = {
    "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/"
};
BatchIndicoResult multiple = indico.summarization.predict(example);
List> results = multiple.getSummary();
System.out.println(results);