TFIDFEngine

Trait TFIDFEngine 

Source
pub trait TFIDFEngine<N>: Send + Sync
where N: Num + Copy,
{ // Required methods fn idf_vec( corpus: &Corpus, token_dim_sample: &IndexSet<Box<str>, RandomState>, ) -> (Vec<N>, f64); fn tf_vec( freq: &TokenFrequency, token_dim_sample: &IndexSet<Box<str>, RandomState>, ) -> (ZeroSpVec<N>, f64); }

Required Methods§

Source

fn idf_vec( corpus: &Corpus, token_dim_sample: &IndexSet<Box<str>, RandomState>, ) -> (Vec<N>, f64)

Method to generate the IDF vector

§Arguments
  • corpus - The corpus
  • token_dim_sample - Token dimension sample
§Returns
  • Vec<N> - The IDF vector
  • denormalize_num - Value for denormalization
Source

fn tf_vec( freq: &TokenFrequency, token_dim_sample: &IndexSet<Box<str>, RandomState>, ) -> (ZeroSpVec<N>, f64)

Method to generate the TF vector

§Arguments
  • freq - Token frequency
  • token_dim_sample - Token dimension sample
§Returns
  • (ZeroSpVec<N>, f64) - TF vector and value for denormalization

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§