Skip to main content
Version: 0.96

snorkelflow.client.transfer.export_ground_truth

snorkelflow.client.transfer.export_ground_truth(node, filepath, is_context=False)

Exports ground truth. Returns a two-column table, where the columns are the x_uid and label. Also writes this table to a CSV file at the provided location.

Examples

>>> sf.export_ground_truth(node_uid, gt_filepath)
# returns a pd.DataFrame
x_uid label
0 doc::001 "SPAM"
1 doc::002 "HAM"

Parameters

NameTypeDefaultInfo
nodeintID of the node to export GT from.
filepathstrPath to the ground truth file we export to. This path must be a path in the local filesystem, i.e. cannot be in S3 or MinIO.
is_contextboolFalseIf True, export a ground truth label for the whole document, if False then just for the span. Only available for information extraction tasks.

Return type

None if there is no gt, otherwise, a pd.DataFrame with columns x_uid and label.