Skip to main content
Version: 25.5

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.

note

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.

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.
Slices Page

Edit slice membership

You can search for a slice, add a new slice, or check and uncheck current slices for the specific datapoint.

  1. Select the Slices Slices icon icon.

  2. Select the Edit slice membership button.

  3. Edit the slice membership:

    • If you want to search for a slice, type the slice name in the Search or add slice bar: Search-Add-Slice
    • If you want to add a new slice, type the slice name in the Search or add slice bar and select Create new slice: Create-New-Slice
    • If you want to check or uncheck current slices for the specific datapoint, select the checkbox next to the slice name.

Manage slices

You can search for a slice, delete a slice, or edit the name of a slice.

  1. Select the Slices Slices icon icon.

  2. Select the Manage slices button.

  3. Manage the slice:

    • To search for a slice, type the slice name in the Search bar: Search-Slices
    • To delete a slice, select the Delete icon to the left of to the slice name: Delete-Slice
    • To edit the name of a slice, type the updated name in the specific slice 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.

  1. Initialize a slice. Use Slice.create() to define a new slice by specifying the dataset, name, and optional description.

  2. Add or remove datapoints. Use add_x_uids(x_uids) to add specific datapoints by UID to a slice.

  3. 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.
  4. 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).