--- title: Encoder - Global description: The Encoder API provides a scriptable object used in Predictive Intelligence stores. This object converts input data into vectors of numbers, based on encoder-specific goals and configurations. Encoders can be used independently to run encodings or can be configured as part of solutions to encode text columns.Creates an encoder.Cancels a job for a encoder object that has been submitted for training.Gets the active EncoderVersion object.Gets all versions of an encoder.Gets the latest version of an encoder.Gets the name of the object to use for interaction with the store.Gets solution object properties.Gets an encoder by provided version number.Activates a specified version of an encoder in the store.Submits a training job. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/EncoderAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 9 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # Encoder- Global The Encoder API provides a scriptable object used in Predictive Intelligence stores. This object converts input data into vectors of numbers, based on encoder-specific goals and configurations. Encoders can be used independently to run encodings or can be configured as part of solutions to encode text columns. This API requires the Predictive Intelligence plugin \(com.glide.platform\_ml\) and is provided within the `sn_ml` namespace. Encoders are text processing objects that are either pre-trained or trained based on the language datasets you provide. You can train encoders that determine how the system interprets and processes text fields. For ML solutions that include text, you can train an encoder to specify how to process text and use the trained encoder in a solution. Encoders have configuration and versions, and can be trained independently with their own retraining frequency. API-defined encoders are different from UI-defined encoders, because the retraining of UI-defined encoders is controlled by the solutions using them. The encoder setup-to-training flow is as follows: 1. Create one or more datasets using the [DatasetDefinition](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/DatasetDefinitionAPI.md) API. 2. Use the [constructor](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) to create an encoder object. 3. Add the encoder object to the encoder store using the [EncoderStore - add\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderStoreAPI.md) method. 4. Train the encoder using the [submitTrainingJob\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) method. This creates a version of the object that you can manage using the [EncoderVersion](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderVersionAPI.md) API. Once you have trained an encoder, you can use it in a solution object: - [ClassificationSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClassificationSolutionAPI.md) - [ClusteringSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md) \(required unless using the Levenshtein distance algorithm\) - [RegressionSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/RegressionSolutionAPI.md) - [SimilaritySolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/SimilaritySolutionAPI.md) \(required\) **Note:** This API runs with full privileges before the Vancouver Patch 7 Hotfix 2b and Washington DC Patch 7 releases. With later releases, grant access using ACLs. For more information see [Query ACLs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/query-acl-rule.md). For usage guidelines, refer to [Using ML APIs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/using-ml-apis.md). **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## Encoder - Encoder\(Object config\) Creates an encoder. To get an encoder for one or more datasets, use this constructor to create a new encoder object with a unique name.
| Name | Type | Description |
|---|---|---|
| config | Object | JavaScript object containing configuration properties of theencoder.``` { "algorithmConfig": {Object}, "datasets": [Array], "domainName": "String", "label": "String", "minRowCount": "String", "processingLanguage": "String", "stopwords": [Array], "trainingFrequency": "String" } ``` |
| config.algorithmConfig | Object | Optional. JavaScript object containing algorithm configuration properties. ``` 'algorithmConfig' : { "algorithm": "String" } ``` |
| config.algorithmConfig.algorithm | String | 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. |
| config.datasets | Array | List of [DatasetDefinition](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/DatasetDefinitionAPI.md) object names. |
| config.domainName | String | Optional. Domain name associated with this dataset. Default: Current domain, for example, `"global"`. |
| config.label | String | Identifies the prediction task. |
| config.minRowCount | String | Optional. Minimum number of records required in the dataset for training.Default: 10000 |
| config.processingLanguage | String | Optional. Processing language in two-letter ISO 639-1 language code format. Default: "en" |
| config.stopwords | Array | 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). Default: English Stopwords |
| config.trainingFrequency | String | 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 |
| 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) object details in the [EncoderStore](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderStoreAPI.md).``` { "algorithmConfig" : {Object}, "datasetsProperties": [Array], "domainName": "String", "label": "String", "name": "String", "processingLanguage": "String", "scope": "String", "stopwords": [Array], "trainingFrequency": "String" } ``` |
| <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>.algorithmConfig | Optional. JavaScript object containing algorithm configuration properties. ``` 'algorithmConfig' : { "algorithm": "String" } ``` Data type: Object. |
| <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>.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. |
| Name | Type | Description |
|---|---|---|
| version | String | Name of the [Encoder\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/EncoderAPI.md) object version to activate.Activating this version deactivates any other version. |