Get All Datasets

Returns a list of datasets and their labels that were created by the current user. The response is sorted by dataset ID.

Response Body

Name

Type

Description

Available Version

data

array

Array of dataset objects.

2.0

object

string

Object returned; in this case, list.

2.0

Dataset Response Body

Name

Type

Description

Available Version

available

boolean

Specifies whether the dataset is ready to be trained.

2.0

createdAt

date

Date and time that the dataset was created.

2.0

id

long

Dataset ID.

2.0

labelSummary

object

Contains the labels array that contains all the labels for the dataset.

2.0

language

string

Dataset language. Default is en_US.

2.0

name

string

Name of the dataset.

2.0

numOfDuplicates

int

Number of duplicate text strings. This number includes duplicates in the .zip file from which the dataset was created plus the number of duplicate text strings from subsequent PUT calls to add text to the dataset.

2.0

object

string

Object returned; in this case, dataset.

2.0

statusMsg

string

Status of the dataset creation and data upload. Valid values are:

  • DELETION_PENDING—Dataset is in the process of being deleted.
  • FAILED: <message>—Data upload has failed.
  • SUCCEEDED—Data upload is complete.
  • UPLOADING—Data upload is in progress.

2.0

totalExamples

int

Total number of examples in the dataset.

2.0

totalLabels

int

Total number of labels in the dataset.

2.0

type

string

Type of dataset data. Valid values are:

  • text-intent
  • text-sentiment

2.0

updatedAt

date

Date and time that the dataset was last updated.

2.0

Labels Response Body

Name

Type

Description

Available Version

datasetId

long

ID of the dataset that the label belongs to.

2.0

id

long

ID of the label.

2.0

name

string

Name of the label.

2.0

numExamples

int

Number of examples in the label.

2.0

Page Through Datasets

By default, this call returns 25 datasets. If you want to page through your datasets, use the offset and count query parameters.

Name

Type

Description

Available Version

count

int

Number of datsets to return. Maximum valid value is 25. If you specify a number greater than 25, the call returns 25 datasets. Optional.

2.0

offset

int

Index of the dataset from which you want to start paging. Optional.

2.0

Here's an example of these query parameters. If you omit the count parameter, the API returns 25 datasets. If you omit the offset parameter, paging starts at 0.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache"  "https://api.einstein.ai/v2/language/datasets?offset=100&count=20"

For example, let's say you want to page through all of your datasets and show 20 at a time. The first call would have offset=0 and count=20, the second call would have offset=20 and count=20, and so on.

Get Global Datasets

Global datasets are public datasets that Salesforce provides. You can use these datasets to include additional data during training when you create a model. To get a list of the global datasets, use the global query parameter.

Name

Type

Description

Available Version

global

boolean

If true, returns all global datasets.

2.0

Here's an example of the global query parameter. The response JSON is the same as for your own custom datasets.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache"  "https://api.einstein.ai/v2/language/datasets?global=true"
Language