After running a rubric evaluation, Docent can cluster judge results to identify
common patterns. See Search and Clustering for a walkthrough.
Get Clustering State
from docent import Docent
client = Docent()
state = client.get_clustering_state("my-collection-id", "rubric-123")
print(f"Job ID: {state.get('job_id')}")
print(f"Centroids: {len(state.get('centroids', []))}")
Parameters
Returns
Clustering state.
List of cluster centroids.
Mapping of centroid IDs to judge result IDs.
Get Cluster Centroids
centroids = client.get_cluster_centroids("my-collection-id", "rubric-123")
for centroid in centroids:
print(centroid)
Parameters
Returns
List of centroid information dictionaries.
Get Cluster Assignments
assignments = client.get_cluster_assignments("my-collection-id", "rubric-123")
for centroid_id, result_ids in assignments.items():
print(f"Cluster {centroid_id}: {len(result_ids)} results")
Parameters
Returns
Mapping of centroid IDs to lists of judge result IDs belonging to that cluster.