pub struct RichLabel {
pub is_correct: bool,
pub error_category: Option<ErrorCategory>,
pub error_message: Option<String>,
pub soft_labels: SoftLabels,
pub ast_diff: Option<AstDiff>,
pub execution_metrics: ExecutionMetrics,
}Expand description
Multi-task label schema
Fields§
§is_correct: boolBinary correctness (ground truth)
error_category: Option<ErrorCategory>Error category (if not correct)
error_message: Option<String>Error message (if not correct)
soft_labels: SoftLabelsSoft labels for gradual correctness
ast_diff: Option<AstDiff>AST diff summary
execution_metrics: ExecutionMetricsExecution metrics
Implementations§
Source§impl RichLabel
impl RichLabel
Sourcepub fn correct(soft_labels: SoftLabels) -> Self
pub fn correct(soft_labels: SoftLabels) -> Self
Create for correct sample
Sourcepub fn incorrect(
category: ErrorCategory,
message: String,
soft_labels: SoftLabels,
) -> Self
pub fn incorrect( category: ErrorCategory, message: String, soft_labels: SoftLabels, ) -> Self
Create for incorrect sample
Sourcepub fn with_ast_diff(self, diff: AstDiff) -> Self
pub fn with_ast_diff(self, diff: AstDiff) -> Self
Set AST diff
Sourcepub fn with_metrics(self, metrics: ExecutionMetrics) -> Self
pub fn with_metrics(self, metrics: ExecutionMetrics) -> Self
Set execution metrics
Sourcepub fn to_feature_vector(&self) -> Vec<f32>
pub fn to_feature_vector(&self) -> Vec<f32>
Convert to flat feature vector for ML
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RichLabel
impl<'de> Deserialize<'de> for RichLabel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RichLabel
impl RefUnwindSafe for RichLabel
impl Send for RichLabel
impl Sync for RichLabel
impl Unpin for RichLabel
impl UnsafeUnpin for RichLabel
impl UnwindSafe for RichLabel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more