toJson method
Implementation
@override
Object toJson() {
return {
if (score != null) 'score': encodeDouble(score),
if (explanation.isNotDefault) 'explanation': explanation,
if (confidence != null) 'confidence': encodeDouble(confidence),
};
}