@@ -44,6 +44,7 @@ class Project(DbObject, Updateable, Deletable):
4444 labeling_parameter_overrides = Relationship .ToMany (
4545 "LabelingParameterOverride" , False , "labeling_parameter_overrides" )
4646 webhooks = Relationship .ToMany ("Webhook" , False )
47+ benchmarks = Relationship .ToMany ("Benchmark" , False )
4748
4849 def create_label (self , ** kwargs ):
4950 """ Creates a label on this project.
@@ -408,6 +409,15 @@ def create_review(self, **kwargs):
408409 kwargs [Review .project .name ] = self .project ()
409410 return self .client ._create (Review , kwargs )
410411
412+ def create_benchmark (self ):
413+ """ Creates a Benchmark for this Label.
414+ Return:
415+ The newly created Benchmark.
416+ """
417+ query_str , params = query .create_benchmark (self )
418+ res = self .client .execute (query_str , params )
419+ res = res ["data" ]["createBenchmark" ]
420+ return Benchmark (self .client , res )
411421
412422class Review (DbObject , Deletable , Updateable ):
413423
@@ -425,6 +435,26 @@ class NetScore(Enum):
425435 project = Relationship .ToOne ("Project" , False )
426436 label = Relationship .ToOne ("Label" , False )
427437
438+ class Benchmark (DbObject ):
439+ """ Benchmarks (also known as Golden Standard) is a quality assurance tool
440+ for training data. Training data quality is the measure of accuracy and
441+ consistency of the training data. Benchmarks works by interspersing data
442+ to be labeled, for which there is a benchmark label, to each person labeling.
443+ These labeled data are compared against their respective benchmark and an
444+ accuracy score between 0 and 100 percent is calculated.
445+ """
446+ created_at = Field .DateTime ("created_at" )
447+ created_by = Relationship .ToOne ("User" , False , "created_by" )
448+ last_activity = Field .DateTime ("last_activity" )
449+ average_agreement = Field .Float ("average_agreement" )
450+ completed_count = Field .Int ("completed_count" )
451+
452+ reference_label = Relationship .ToOne ("Label" , False , "reference_label" )
453+
454+ def delete (self ):
455+ query_str , params = query .delete_benchmark (self .reference_label ())
456+ self .client .execute (query_str , params )
457+
428458
429459class AssetMetadata (DbObject ):
430460 """ AssetMetadata is a datatype to provide extra context about an asset
0 commit comments