Relevance

Relevance V1 will be removed on April 15th, 2019. Relevance V2 is now available.

relevance(data, queries, {[api_key]: String, [cloud]: String})
Convert text into meaningful feature vectors.
Extracts abstract text features for use as inputs to learning algorithms.

Current Version: 1

Arguments

data – String | List – required – text to be analyzed
queries – String | List – required – a list of queries to run against the document
[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

Output

This function returns a list of floating point values representing the relevance of a given search query to the provided document or documents. The `data` argument and the `queries` argument may be either a single text string or a list of text strings.

# single output
[0.6740826540660497, 0.16670130847921036]

# batch output
[
    [0.16670130847921036],
    [0.2949661163493879]
]

Example

require 'indico'
Indico.api_key =  'YOUR_API_KEY'

# single example
Indico.relevance("Renowned soccer legend Pele will be visiting...", ["team sports", "royalty"])

# batch example
Indico.relevance(["Renowned soccer legend Pele will be visiting...", "The Queen of England will be visiting..."], ["royalty"])