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 1000Parameters
Parameters
Return type
Return type
pd.Series
Name Type Default Info node int
UID of the node whose annotations we are fetching. source_name Optional[str]
None
The name of the source (annotator, aggregation, etc). x_uids Optional[List[str]]
None
An optional list of x_uids. batch_uids Optional[List[int]]
None
An optional list of batch uids.