pub struct SpeechClassifier { /* private fields */ }Expand description
A thread-safe classifier backed by one SQLite database.
Implementations§
Source§impl SpeechClassifier
impl SpeechClassifier
Sourcepub fn execute_ktool(&self, call: KtoolCall) -> Result<String, KtoolError>
pub fn execute_ktool(&self, call: KtoolCall) -> Result<String, KtoolError>
Validates, executes, and renders one decoded model-facing classifier operation.
Source§impl SpeechClassifier
impl SpeechClassifier
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn open(path: impl AsRef<Path>) -> Result<Self, Error>
Opens or creates a classifier database and rebuilds current state from its event log.
Sourcepub fn identify(
&self,
key: ObservationKey,
cohort: Cohort,
row: FeatureRow,
threshold: f64,
) -> Result<IdentifyOutcome, Error>
pub fn identify( &self, key: ObservationKey, cohort: Cohort, row: FeatureRow, threshold: f64, ) -> Result<IdentifyOutcome, Error>
Scores an observation and atomically retains it when the threshold is met.
Sourcepub fn train(
&self,
key: ObservationKey,
cohort: Cohort,
row: FeatureRow,
speaker_id: String,
) -> Result<TrainOutcome, Error>
pub fn train( &self, key: ObservationKey, cohort: Cohort, row: FeatureRow, speaker_id: String, ) -> Result<TrainOutcome, Error>
Adds known training data or atomically corrects the current assignment.
Sourcepub fn delete(&self, key: ObservationKey) -> Result<DeleteOutcome, Error>
pub fn delete(&self, key: ObservationKey) -> Result<DeleteOutcome, Error>
Idempotently deletes the current observation for a key.
Auto Trait Implementations§
impl !Freeze for SpeechClassifier
impl RefUnwindSafe for SpeechClassifier
impl Send for SpeechClassifier
impl Sync for SpeechClassifier
impl Unpin for SpeechClassifier
impl UnsafeUnpin for SpeechClassifier
impl UnwindSafe for SpeechClassifier
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