Package akka.javasdk.agent
Record Class Classification
- Record Components:
score- a numeric score, if the classifier produces onelabel- a categorical label, if the classifier produces one (may be derived from the score)confidence- the classifier's confidence in its own result, if availableattributes- any extra key-value detail the classifier wants to attach
public record Classification(Optional<Double> score, Optional<String> label, Optional<Double> confidence, Map<String,String> attributes)
extends Record
The result of a
Classifier: a score and/or label, with optional confidence and
attributes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.Returns the value of theconfidencerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.static ClassificationCreates aClassificationwith only a label.static ClassificationCreates aClassificationwith both a score and a label.score()Returns the value of thescorerecord component.static Classificationscore(double score) Creates aClassificationwith only a score.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Classification
public Classification(Optional<Double> score, Optional<String> label, Optional<Double> confidence, Map<String, String> attributes) Creates an instance of aClassificationrecord class.- Parameters:
score- the value for thescorerecord componentlabel- the value for thelabelrecord componentconfidence- the value for theconfidencerecord componentattributes- the value for theattributesrecord component
-
-
Method Details
-
score
Creates aClassificationwith only a score. -
label
Creates aClassificationwith only a label. -
of
Creates aClassificationwith both a score and a label. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
score
Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
confidence
Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-