Text Tags

textTags(data, {[apiKey]: String, [privateCloud]: String, [top_n]: Integer, [threshold]: Float, [relative]: Boolean})
Determine the topics in the phrase or document.

Current Version: 2

Arguments

data – String | List – required – text to be analyzed
[apiKey] – String – optional – your indico API key
[privateCloud] – String – optional – your private cloud subdomain
[v or version] – Integer – optional (defaults to 2) – specify model version
[top_n] – Integer – optionals – only return this many of the most likely topics
[threshold] – Float (defaults to 0.) – optional – only return topics with likelihood greater than this number

Output

This function will return a dictionary with 111 key-value pairs. These key-value pairs represent the likelihood that the analyzed text is about each of the 111 possible topics. The keys in the dictionary are strings containing the topic names and the values are the probabilities that the analyzed text is about each topic.

# single output
{
    'anime': 0.003982535730280216,
    'anthropology': 0.020311181569223534,
    'archery': 0.4893124752591462,
    ... 105 topics omitted ...,
    'wrestling': 0.0009661379304299885,
    'writing': 0.00532591437084736,
    'yoga': 0.001874647791589776
}

# batch output
[
    {
        'anime': 0.003982535730280216,
        'anthropology': 0.020311181569223534,
        'archery': 0.4893124752591462,
        ... 105 topics omitted ...,
        'wrestling': 0.0009661379304299885,
        'writing': 0.00532591437084736,
        'yoga': 0.001874647791589776
    },
    {
        'anime': 0.0020400125677411812,
        'anthropology': 0.010790799662278016,
        'archery': 0.002072348777350773,
        ... 105 topics omitted ...,
        'wrestling': 0.0012626451944395167,
        'writing': 0.004772236821288096,
        'yoga': 0.22969626130844248
    }
]

Complete List of Tags

anime, anthropology, archery, architecture, art, astronomy, atheism, aviation, baseball, beer, bicycling, biology, books, boxing, buddhism, business, cars, christianity, climbing, comedy, comics, conspiracy, cooking, crafts, cricket, design, dieting, diy, drugs, economic_discussion, education, electronics, energy, entertainment_news, environmental, fashion, fiction, film, fishing, fitness, gaming, gardening, gender_issues, general_food, golf, guns, health, history, hockey, hunting, individualist_politics, investment, islam, jobs, judaism, left_politics, lgbt, math, medicine, military, music, nba, news, nfl, nostalgia, nutrition, parenting, personal, personal_care_and_beauty, personalfinance, pets, philosophy, photography, poetry, poker, political_discussion, programming, psychology, realestate, relationships, religion, right_politics, romance, rugby, running, sailing, school, science, scuba, singing, skateboarding, soccer, sports, startups_and_entrepreneurship, surfing, swimming, tattoo, technology, television, tennis, travel, ultimate, vegan, vegetarian, weather, wedding, weight_training, wine, wrestling, writing, yoga

Example

var indico = require('indico.io');
indico.apiKey =  'YOUR_API_KEY';

var response = function(res) { console.log(res); }
var logError = function(err) { console.log(err); }

// single example
indico.textTags("The most common form of arrow consists of a shaft with an arrowhead attached to the front end and with fletchings and a nock attached to the other end.")
  .then(response)
  .catch(logError);

// batch example
var batchInput = [
    "The most common form of arrow consists of a shaft with an arrowhead attached to the front end and with fletchings and a nock attached to the other end.",
    "Yoga in Indian traditions, however, is more than physical exercise, it has a meditative and spiritual core."
];

indico.textTags(batchInput)
  .then(response)
  .catch(logError);