Skip to main content

is_it_slop_preprocessing/pre_processor/
mod.rs

1//! Text preprocessing pipeline for machine learning.
2//!
3//! This module provides a complete text processing pipeline combining:
4//! - Text cleaning (HTML entities, encoding artifacts, dataset-specific patterns)
5//! - Tokenization (tiktoken BPE encoding)
6//! - Token-based chunking (splitting long documents into overlapping segments)
7//! - TF-IDF vectorization with token n-grams
8//! - Statistical feature extraction (writing style analysis)
9//!
10//! The pipeline is designed for both training (Python bindings) and inference (native Rust),
11//! with automatic parallelization and sparse matrix representations for efficiency.
12mod chunker;
13mod cleaner;
14#[cfg(feature = "statistical-features")]
15pub mod features;
16pub mod ngrams;
17mod tokenizer;
18mod vectorizer;
19pub use chunker::TokenChunker;
20pub use cleaner::{TextCleaner, text_cleaner_for_inference, text_cleaner_for_training};
21#[cfg(feature = "statistical-features")]
22pub use features::{
23    extract_chunk_features, extract_combined_batch, extract_combined_features,
24    extract_document_features,
25};
26pub use tokenizer::{attempt_reverse_tokenize, reverse_tokenize, tokenize};
27pub use vectorizer::{
28    CountVectorizer, DEFAULT_MAX_NGRAM, DEFAULT_MIN_NGRAM, TfidfVectorizer, TfidfVectorizerBuilder,
29    VectorizerParams,
30};