Skip to main content
Version: 0.93

Versioning ground truth

This lesson demonstrates how to save multiple different versions of Ground Truth for your data. This applies to use cases involving various iterations on the Ground Truth, where users can save and load previous versions of Ground Truth for future model results. We provide walk-throughs for how to version (i.e., save, load, delete) Ground Truth in both the UI and the SDK.

Versioning ground truth in the UI

We can manage our Ground Truth by navigating to the Develop page of an application and finding the Manage GT versions button in the Ground Truth section to access the Ground Truth versions page. The Ground Truth section displays the label distribution for each label in our schema for our specified data split. The example below shows the total number of LOAN and NOT_LOAN data points in our dev split.

Clicking on the Manage GT versions brings you to the full list of Ground truth versions saved for your application. You can load a previously saved ground truth version by simply clicking Load, or delete an existing ground truth version by simply clicking the trash icon. The small green checkmark signifies the currently active ground truth version used for model results.

To save the current ground truth as a new version, use Create GT Version button to provide a unique name and description for the version.

Apart from manually created ones, ground truth versions are also automatically created when batch annotations are saved or when a model is trained on ground truth that is not already saved as a version. Auto-saved versions are prefixed with auto.

Versioning ground truth in the SDK

The SDK provides methods to save, load, list, and delete ground truth versions.

  • gts.create_ground_truth_version SDK method can save the current ground truth as a new version.
import snorkelflow.client as sf

node = sf.get_model_node(APP_NAME) # Grab model node from desired application

sf.gts.create_ground_truth_version(
node=node, # Model node in application
name='new_gt', # Name of new ground truth version
description='Recent GT additions to data' # Description for new ground truth version
)
  • gts.load_ground_truth_version SDK method can be used to load a specific version of ground truth.
import snorkelflow.client as sf

node = sf.get_model_node(APP_NAME) # Grab model node from desired application

sf.gts.load_ground_truth_version(
node=node, # Model node in application
gt_version_uid=1576 # UID for ground truth version, found in UI
)
  • gts.delete_ground_truth_version SDK method can be used to delete a specific version of ground truth.
import snorkelflow.client as sf

node = sf.get_model_node(APP_NAME) # Grab model node from desired application

sf.gts.delete_ground_truth_version(
node=node, # Model node in application
gt_version_uid=1576 # UID for ground truth version, found in UI
)
  • gts.list_ground_truth_versions SDK method can be used to list all the versions of ground truth that have been saved for a node.
import snorkelflow.client as sf

node = sf.get_model_node(APP_NAME) # Grab model node from desired application

sf.gts.list_ground_truth_versions(
node=node # Model node in application
)