Spam filter performance and accuracy improvements (part 6)

This commit is contained in:
mdecimus
2025-12-05 18:31:33 +01:00
parent c467ce07f1
commit 84edb5e6db
37 changed files with 3998 additions and 858 deletions

View File

@@ -83,7 +83,7 @@ impl TextClassifier {
}
}
fn predict_proba_sample(&self, features: &Features) -> f32 {
pub fn predict_proba_sample(&self, features: &Features) -> f32 {
let mut z: f32 = 0.0;
for (idx, feature) in &features.0 {
z += self.weights[*idx as usize] * *feature;

View File

@@ -73,6 +73,7 @@ impl WordStemTokenizer {
}
}
/*
pub fn symbols(input: &str) -> bool {
hashify::set!(
input.as_bytes(),
@@ -7824,6 +7825,7 @@ pub fn symbols(input: &str) -> bool {
)
}
*/
#[cfg(test)]
pub mod tests {
use crate::tokenizers::{