--- title: EncoderVersion - Global description: The EncoderVersion API provides a scriptable object used in Predictive Intelligence stores.Gets encoder object properties and version number.Returns vectors for each input sentence.Returns words similar to each input word in the descending rank order of similarity.Gets training completion status.Gets the version number of a solution object.Returns vectors for each input word. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/EncoderVersionAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 6 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # EncoderVersion- Global 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) objects in the [Encoder store](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderStoreAPI.md). 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. Methods in this API are accessible using the following Encoder methods: - [getActiveVersion\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) - [getAllVersions\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) - [getLatestVersion\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) - [getVersion\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## EncoderVersion - getProperties\(\) Gets encoder object properties and version number. |Name|Type|Description| |----|----|-----------| |None| | |
| Type | Description |
|---|---|
| Object | Contents of the Dataset and [Encoder](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) details. Results vary by object property setup.``` { "algorithmConfig" : {Object}, "datasetsProperties": [Array], "domainName": "String", "isActive": "String", "label": "String", "name": "String", "predictedFieldName": "String", "processingLanguage": "String", "scope": "String", "stopwords": [Array], "trainingFrequency": "String", "versionNumber": "Number" } ``` |
| <Object>.algorithmConfig | Optional. JavaScript object containing algorithm configuration properties. ``` 'algorithmConfig' : { "algorithm": "String" } ``` Data type: Object. |
| <Object>.algorithmConfig.algorithm | Name of the algorithm for training this encoder. Possible values: - **paravec**: Paragraph vector word embedding. - **tf-idf**: Term Frequency–Inverse Document Frequency \(TF-IDF\)-based text. Data type: String. |
| <Object>.datasetsProperties | List of [DatasetDefinition\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/DatasetDefinitionAPI.md) properties associated with the encoder. ``` { "encodedQuery": "String", "fieldDetails": [Array], "fieldNames": [Array], "tableName": "String" } ``` Data type: Array. |
| <Object>.datasetsProperties.tableName | Name of the table for the dataset. For example, `"tableName" : "Incident"`. Data type: String. |
| <Object>.datasetsProperties.fieldNames | List of field names from the specified table as strings. For example, `"fieldNames" : ["short_description", "priority"]`. Data type: Array. |
| <Object>.datasetsProperties.fieldNames.fieldDetails | List of JavaScript objects that specify field properties. ``` [ { "name": "String", "type": "String" } ] ``` Data type: Array. |
| <Object>.datasetsProperties.fieldNames.fieldDetails.<object>.name | Name of the field defining the type of information to restrict this dataset to. Data type: String. |
| <Object>.datasetsProperties.fieldDetails.<object>.type | Machine-learning field type. Data type: String. |
| <Object>.datasetsProperties.fieldDetails.encodedQuery | Encoded query string in the standard platform format. See [Encoded query strings](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/c_EncodedQueryStrings.md).Data type: String. |
| <Object>.domainName | Domain name associated with this dataset. See [Domain separation and Predictive Intelligence](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/domain-separation-predictive-intelligence.md).Type: String |
| <Object>.isActive | Flag that indicates whether this version is active.Valid values: - true: Version is active. - false: Version is not active. Data type: String |
| <Object>.label | Identifies the prediction task. ``` { "label": "my first prediction" } ``` Data type: String. |
| <Object>.name | System-assigned name. Data type: String. |
| <Object>.predictedFieldName | Identifies a field to be trained for predictability. Data type: String. |
| <Object>.processingLanguage | Processing language in two-letter ISO 639-1 language code format. Data type: String. |
| <Object>.scope | Object scope. Currently the only valid value is `global`.Data type: String |
| <Object>.stopwords | Optional. Preset list of strings that the system automatically generates based on the **language** property setting. For details, see [Create a custom stopwords list](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/create-custom-stopwords-list.md). Data type: Array. |
| <Object>.trainingFrequency | The frequency to retrain the model. Possible values: - every\_30\_days - every\_60\_days - every\_90\_days - every\_120\_days - every\_180\_days - run\_once Default: run\_once Data type: String. |
| <Object>.versionNumber | Version number of the Encoder object.Data type: String. |
| Name | Type | Description |
|---|---|---|
| input | Array | Array of words for which to find similar words. |
| options | Object | Map to refine results. ``` { "topN":"String" } ``` |
| 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. |
| Name | Type | Description |
|---|---|---|
| includeDetails | Boolean | Flag that indicates whether to return status **details**.Valid values: - true: Return additional details. - false: Don't return additional details. Default: False |
| Type | Description |
|---|---|
| Object | JavaScript object containing training status information for an [Encoder](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) object.``` { "state": "String", "percentComplete": "Number as a String", "hasJobEnded": "Boolean value as a String", "details": {Object} } ``` |
| <Object>.state | Training completion state. If the training job reaches a terminal state, the job does not leave that state. If the state is terminal, the **hasJobEnded** property is set to `true`.Possible values: - `fetching_files_for_training` - `preparing_data` - `retry` - `solution_cancelled` \(terminal\) - `solution_complete`\(terminal\) - `solution_error` \(terminal\) - `solution_incomplete` - `training_request_received` - `training_request_timed_out` \(terminal\) - `training_solution` - `uploading_solution` - `waiting_for_training` Data type: String |
| <Object>.hasJobEnded | Flag that indicates whether training is complete.Valid values: - true: Training is complete. - false: Training is incomplete. Data type: Boolean value as a String |
| <Object>.percentComplete | Training percent complete. If the completion percentage is less than 100, the job might be in a terminal state. For example, if training times out.Data type: Number as a String Range: 0 thru 100 |
| <Object>.details | Object containing a list of additional training details.Data type: Object |