Skip to content

Statistic

meganno_client.statistic.Statistic

The Statistic class contains methods to show basic statistics of the labeling project. Mostly used to back views in the monitoring dashboard.

Attributes:

Name Type Description
__service Service

Service object for the connected project.

get_label_progress()

Get the overall progress of annotation.

Returns:

Name Type Description
response dict

A dictionary with fields total showing total number for data records, and annotated showing number of records with any label from at least one annotator.

get_label_distributions(label_name: str = None)

Get the class distribution of a selected label. If multiple annotators labeled the same record, aggregate using majority vote.

Parameters:

Name Type Description Default
label_name str

Name of label as specified in the schema.

None

Returns:

Name Type Description
response dict

A dictionary showing aggregated class frequencies. Example: {'neg': 60, 'neu': 14, 'pos': 27, 'tied_annotations': 3}. tied_annotation counts numbers of record when there's more than majority voted classes.

get_annotator_contributions()

Get contributions of annotators in terms of records labeled.

Returns:

Name Type Description
response dict

A dictionary where keys are annotator IDs and values are total numbers of annotated records by each annotator.

get_annotator_agreements(label_name: str = None)

Get pairwise agreement score between all contributing annotators to the project, on the specified label. The default agreement calculation method is cohen_kappa.

Parameters:

Name Type Description Default
label_name str

Name of label as specified in the schema.

None

Returns:

Name Type Description
response dict

A dictionary where keys are pairs of annotator IDs, and values are their agreement scores. The higher the scores are, the more frequent the pairs of annotators agree.

get_embeddings(label_name: str = None, embed_type: str = None)

Return 2-dimensional TSNE projection of the text embedding for data records, together with their aggregated labels (using majority votes). Used for projection view in the monitoring dashboard.

Parameters:

Name Type Description Default
label_name str

Name of label as specified in the schema.

None
embed_type str

the meta_name for the specified embedding

None

Returns:

Name Type Description
response dict

A dictionary with fields agg_label showing aggregated class label, x_axis and y_axis showing projected 2d coordinates.