Skip to main content
Version: 25.4

snorkelflow.client.annotations.get_annotations

snorkelflow.client.annotations.get_annotations(node, source_name=None, x_uids=None, batch_uids=None)

Get a collection of annotations for a particular node. Annotations are returned in a Pandas Series. The returned Pandas Series has a MultiIndex with the first level being the x_uid and the second level being the annotation_uid. You can increase the granularity of annotations retrieved by specifying a source name, a list of x_uids, or a list of batch_uids. batch_uids can be accessed by using the sf.get_batches function.

Examples

>>> annotations = sf.get_annotations(node)
>>> annotations.loc["doc::1"] # Get annotations for doc::1
>>> annotations.loc[:, 1000] # Get an annotation of annotation_uid 1000

Parameters

NameTypeDefaultInfo
nodeintUID of the node whose annotations we are fetching.
source_nameOptional[str]NoneThe name of the source (annotator, aggregation, etc).
x_uidsOptional[List[str]]NoneAn optional list of x_uids.
batch_uidsOptional[List[int]]NoneAn optional list of batch uids.

Return type

pd.Series