Twitter Engagement

The Twitter Engagement API will be removed on April 15th, 2019.

twitterEngagement.predict(data, [params])

Arguments

data – String | List – required – text to be analyzed
[api_key] – String – optional – your indico API key
[cloud] – String – optional – your private cloud subdomain

Output

This function will return a number between 0 and 1. This number is a probability representing the confidence that the analyzed text will be retweeted or favorited. Values greater than 0.5 indicate high engagement content, while values less than 0.5 indicate low engagement content.

# single output
0.640490385821421

# batch output
[
    0.640490385821421,
    0.44804264881126155
]

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.twitterEngagement.predict(
    "Don't forget to vote tomorrow! #democracy #tom4classpresident"
);
Double result = single.getTwitterEngagement();
System.out.println(result);

// batch example
String[] example = {
    "Don't forget to vote tomorrow! #democracy #tom4classpresident",
    "Severe weather warning. We advise you stay home. #weather #tornado #storm"
};
BatchIndicoResult multiple = indico.twitterEngagement.predict(example);
List results = multiple.getTwitterEngagement();
System.out.println(results);