pub struct IntentClassifier { /* private fields */ }
Expand description
Main intent classifier that handles training and prediction
Implementations§
Source§impl IntentClassifier
impl IntentClassifier
Sourcepub async fn with_config(config: ClassifierConfig) -> Result<Self>
pub async fn with_config(config: ClassifierConfig) -> Result<Self>
Create a new intent classifier with custom configuration
Sourcepub async fn predict_intent(&self, text: &str) -> Result<IntentPrediction>
pub async fn predict_intent(&self, text: &str) -> Result<IntentPrediction>
Predict intent from natural language text
Sourcepub async fn classify(
&self,
request: ClassificationRequest,
) -> Result<ClassificationResponse>
pub async fn classify( &self, request: ClassificationRequest, ) -> Result<ClassificationResponse>
Classify text with additional request options
Sourcepub async fn add_training_example(&self, example: TrainingExample) -> Result<()>
pub async fn add_training_example(&self, example: TrainingExample) -> Result<()>
Add a training example
Sourcepub async fn add_feedback(&self, feedback: IntentFeedback) -> Result<()>
pub async fn add_feedback(&self, feedback: IntentFeedback) -> Result<()>
Add user feedback to improve the classifier
Sourcepub async fn get_stats(&self) -> ClassifierStats
pub async fn get_stats(&self) -> ClassifierStats
Get classifier statistics
Sourcepub async fn export_training_data(&self) -> Result<String>
pub async fn export_training_data(&self) -> Result<String>
Export training data as JSON
Sourcepub async fn import_training_data(&self, json_data: &str) -> Result<()>
pub async fn import_training_data(&self, json_data: &str) -> Result<()>
Import training data from JSON
Sourcepub async fn clear_training_data(&self) -> Result<()>
pub async fn clear_training_data(&self) -> Result<()>
Clear all training data
Trait Implementations§
Source§impl Clone for IntentClassifier
impl Clone for IntentClassifier
Source§fn clone(&self) -> IntentClassifier
fn clone(&self) -> IntentClassifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for IntentClassifier
impl !RefUnwindSafe for IntentClassifier
impl Send for IntentClassifier
impl Sync for IntentClassifier
impl Unpin for IntentClassifier
impl !UnwindSafe for IntentClassifier
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