1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! # Intent Classification Library
//!
//! A flexible few-shot intent classification library for natural language processing.
//! This library provides a simple API for classifying user intents from text using
//! machine learning and rule-based approaches.
//!
//! ## Features
//!
//! - **Few-shot learning**: Train the classifier with minimal examples
//! - **Bootstrap data**: Comes with pre-trained examples for common intents
//! - **Feedback learning**: Improve accuracy through user feedback
//! - **Async support**: Fully async API for non-blocking operations
//! - **Serializable**: Export/import training data as JSON
//! - **Configurable**: Customize behavior through configuration
//!
//! ## Quick Start
//!
//! ```rust
//! use intent_classifier::{IntentClassifier, TrainingExample, TrainingSource, IntentId};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a new classifier
//! let classifier = IntentClassifier::new().await?;
//!
//! // Predict an intent
//! let prediction = classifier.predict_intent("merge these JSON files together").await?;
//! println!("Intent: {}, Confidence: {:.3}",
//! prediction.intent, prediction.confidence.value());
//!
//! // Add custom training data
//! let example = TrainingExample {
//! text: "calculate the sum of these numbers".to_string(),
//! intent: IntentId::from("math_operation"),
//! confidence: 1.0,
//! source: TrainingSource::Programmatic,
//! };
//! classifier.add_training_example(example).await?;
//!
//! // Get statistics
//! let stats = classifier.get_stats().await;
//! println!("Training examples: {}", stats.training_examples);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Examples
//!
//! For more examples, see the `examples/` directory in the repository.
// Re-export main types for convenience
pub use *;
pub use IntentClassifier;
// Re-export commonly used types
pub use ;