Using data slices
A slice is a filtered subset of data rows that share a specific characteristic, like a topic, language, or error type. By using filters, users can create slices to focus on high-impact data areas for analysis, debugging, and targeted model training.
Slices are created by directly assigning individual datapoints to a slice.
Slices have some limitations:
- You cannot create batches from a slice.
- Slices cannot be directly used for model training.
- Slice definitions cannot be exported between projects.
When to use slices
There are two primary use cases for using slices within the Snorkel AI Data Development Platform—annotator and data scientist.
Annotator
As an annotator, you can create slices to focus on specific data segments that need careful labeling or review, which helps prioritize data that aligns with specific project goals.
- For more information about how to annotate, see Walkthrough for annotators.
- For more information about how to review annotations, see Walkthrough for reviewers.
Data scientist
As a data scientist, you can use slices to analyze model performance on specific subsets and improve model accuracy in targeted areas. In the Evaluate page, data scientists can track model performance across slices, helping identify where the model is excelling or needs improvement. In Studio, data scientists can filter data by slice to focus on high impact subsets for training and error analysis. Continue reading to learn more about how to create and use slices through the UI and SDK.
Where to find slices
- Annotation Suite
- Studio Page
- Evaluate Page
- Batches
- Slices Page
Slices page
The Slices page provides a centralized view of all slices in your dataset and allows you to manage them efficiently.
From your dataset, select the Slices tab.
On the Slices page, you can:
- View all slices created for the dataset.
- Search for specific slices using the search bar.
- View slice details including creation information and last modified date.
- Edit slice names and descriptions by hovering over the cell and selecting the rename icon.
- Delete slices by hovering over the slice and selecting the trash can icon.

Edit slice membership
You can search for a slice, add a new slice, or check and uncheck current slices for the specific datapoint.
-
Select the Slices
icon.
-
Select the Edit slice membership button.
-
Edit the slice membership:
- If you want to search for a slice, type the slice name in the Search or add slice bar:
- If you want to add a new slice, type the slice name in the Search or add slice bar and select Create new slice:
- If you want to check or uncheck current slices for the specific datapoint, select the checkbox next to the slice name.
- If you want to search for a slice, type the slice name in the Search or add slice bar:
Manage slices
You can search for a slice, delete a slice, or edit the name of a slice.
-
Select the Slices
icon.
-
Select the Manage slices button.
-
Manage the slice:
- To search for a slice, type the slice name in the Search bar:
- To delete a slice, select the Delete icon to the left of to the slice name:
- To edit the name of a slice, type the updated name in the specific slice bar.
- To search for a slice, type the slice name in the Search bar:
Manage slices using the SDK
In the SDK, use the slice
class to create and manage subsets of data slices within a dataset. Slices are manually defined and accessed through the create()
and get()
methods.
-
Initialize a slice. Use
Slice.create()
to define a new slice by specifying the dataset, name, and optional description. -
Add or remove datapoints. Use
add_x_uids(x_uids)
to add specific datapoints by UID to a slice. -
Retrieve and list slices:
- Use
Slice.get(dataset, slice)
to retrieve a specific slice. - Use
Slice.list(dataset)
to list all slices associated with a dataset.
- Use
-
Updating and managing slices:
- Modify properties like name or description using
update([name, description])
. - Remove datapoints by UID from a slice using
remove_x_uids(x_uids)
.
- Modify properties like name or description using