Text Features

Text Features V1 has been superceded by Text Features V2 as of Nov. 1st, 2018.

textFeatures(data, {[apiKey], [privateCloud]})
Convert text into meaningful feature vectors.
Extracts abstract text features for use as inputs to learning algorithms.

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

Output

List of 300 numbers (floats). Each number corresponds to the strength of that feature in the feature vector.

# single output
[
    0.0545490713952761,
    0.023423018957352944,
    0.003421281571050769,
    ... 294 features omitted ...,
    -0.0599560840072811,
    0.07137194953658677,
    -0.008098228765861361
]

# batch output
[
    [
        0.0545490713952761,
        0.023423018957352944,
        0.003421281571050769,
        ... 294 features omitted ...,
        -0.0599560840072811,
        0.07137194953658677,
        -0.008098228765861361
    ],
    [
        0.0545490713952761,
        0.023423018957352944,
        0.003421281571050769,
        ... 294 features omitted ...,
        -0.0599560840072811,
        0.07137194953658677,
        -0.008098228765861361
    ]
]

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.textFeatures("There are so many things you can learn from text.")
  .then(response)
  .catch(logError);

// batch example
var batchInput = [
    "There are so many things you can learn from text.",
    "You could use the features to train a model!"
];
indico.textFeatures(batchInput)
  .then(response)
  .catch(logError);