diff --git a/api/src/resources/dataset.rs b/api/src/resources/dataset.rs index c1f04307..9074a3f7 100644 --- a/api/src/resources/dataset.rs +++ b/api/src/resources/dataset.rs @@ -55,6 +55,9 @@ pub struct Dataset { pub struct DatasetStats { pub total_verbatims: NotNan, pub validation: Option, + pub number_of_labels: usize, + pub number_of_fields: usize, + pub number_of_extraction_defs: usize, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] diff --git a/cli/src/commands/get/datasets.rs b/cli/src/commands/get/datasets.rs index 228f1077..6a66cef9 100644 --- a/cli/src/commands/get/datasets.rs +++ b/cli/src/commands/get/datasets.rs @@ -80,6 +80,13 @@ pub fn get( stats: DatasetStats { total_verbatims: unfiltered_stats.num_comments, validation: validation_response.ok(), + number_of_labels: dataset.label_defs.len(), + number_of_fields: dataset.entity_defs.len(), + number_of_extraction_defs: dataset + .label_defs + .iter() + .map(|l| if l.moon_form.is_some() { 1 } else { 0 }) + .sum(), }, }) };