EncoderVersion - Global
-
- UpdatedJan 30, 2025
- 5 minutes to read
- Yokohama
- API reference
The EncoderVersion API provides a scriptable object used in Predictive Intelligence stores.
This API requires the Predictive Intelligence plugin (com.glide.platform_ml) and is provided
within the sn_ml
namespace.
This API is used for working with encoder versions based on Encoder API objects in the Encoder store.
The system activates the most recent version of the encoder when it completes training, and only allows one version to be active at a time. However, you can activate any previously trained version you want to use to make predictions.
EncoderVersion - getProperties()
Gets encoder object properties and version number.
Name | Type | Description |
---|---|---|
None |
Example
The following example gets properties of the active object version in the store.
Output:
EncoderVersion - getSentenceVectors(Array input)
Returns vectors for each input sentence.
Name | Type | Description |
---|---|---|
input | Array | Array of strings as sentences from which to receive vectors. |
Type | Description |
---|---|
String | Array of sentence vectors. |
Example
The following example shows how to return a vector for a single sentence.
Output:
EncoderVersion - getSimilarWords(Array input, Object options)
Returns words similar to each input word in the descending rank order of similarity.
Name | Type | Description |
---|---|---|
input | Array | Array of words for which to find similar words. |
options | Object | Map to refine results. |
options.topN | String | If provided, returns the top results up to the
specified number of words. For example, use "10" to return the top 10 most
similar words. |
Type | Description |
---|---|
Array | List of elements containing the similar words for the input word in the
corresponding position. These similar words are represented by an of array of pairs
in the format [word, similarity score] . |
Example
The following example shows how to get similar words using the GloVe encoder.
Output:
EncoderVersion - getStatus(Boolean includeDetails)
Gets training completion status.
Name | Type | Description |
---|---|---|
includeDetails | Boolean | Flag that indicates whether to return status details. Valid values:
Default: False |
Example
The following example shows a successful result with training complete.
Output:
Example
The following example shows an unsuccessful result with training complete.
Output:
EncoderVersion - getVersionNumber()
Gets the version number of a solution object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Version number. |
Example
The following example shows how to get a version number.
Output:
EncoderVersion - getWordVectors(Array input)
Returns vectors for each input word.
Name | Type | Description |
---|---|---|
input | Array | List of strings as words from which to receive vectors. |
Type | Description |
---|---|
Array | List of vectors for each word provided. |
Example
The following example shows how to get a vector from the word hello.
Output: