use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub struct RawPrediction {
pub kind: Option<String>,
pub label: Option<String>,
pub text: Option<String>,
pub score: Option<f32>,
#[serde(default)]
pub attributes: BTreeMap<String, String>,
}
impl RawPrediction {
pub fn label(label: impl Into<String>, score: f32) -> Self {
Self {
label: Some(label.into()),
score: Some(score),
..Self::default()
}
}
}