Text Features

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

text_features(data, {[api_key], [cloud]})
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
[api_key] – String – optional – your indico API key
[cloud] – 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

require 'indico'
Indico.api_key =  'YOUR_API_KEY'

# single example
Indico.text_features("There are so many things you can learn from text.")

# batch example
Indico.text_features([
    "There are so many things you can learn from text.",
    "You could use the features to train a model!"
])