pub struct BagOfWordsCosineSimilarityFeatureGroup {
pub source_column_name_a: String,
pub source_column_name_b: String,
pub strategy: BagOfWordsFeatureGroupStrategy,
pub tokenizer: Tokenizer,
pub ngram_types: FnvHashSet<NGramType>,
pub ngrams: IndexMap<NGram, BagOfWordsFeatureGroupNGramEntry, FnvBuildHasher>,
}
Expand description
A BagOfWordsCosineSimilarityFeatureGroup creates features for comparing two text columns using the cosine similarity of the Bag of Words representation of each text column.
Fields§
§source_column_name_a: String
This is the name of the first text column used to compute features with this feature group.
source_column_name_b: String
This is the name of the second text column used to compute features with this feature group.
strategy: BagOfWordsFeatureGroupStrategy
The strategy specifies how to compute feature values given the tokens in the source column.
tokenizer: Tokenizer
This is the tokenizer used to split the text into tokens.
ngram_types: FnvHashSet<NGramType>
These are the ngram types used to create features.
ngrams: IndexMap<NGram, BagOfWordsFeatureGroupNGramEntry, FnvBuildHasher>
These are the ngrams, one for each feature in this feature group.
Implementations§
Source§impl BagOfWordsCosineSimilarityFeatureGroup
impl BagOfWordsCosineSimilarityFeatureGroup
pub fn compute_table( &self, column_a: TableColumnView<'_>, column_b: TableColumnView<'_>, progress: &impl Fn(u64), ) -> TableColumn
pub fn compute_array_f32( &self, features: ArrayViewMut2<'_, f32>, column_a: TableColumnView<'_>, column_b: TableColumnView<'_>, progress: &impl Fn(), )
pub fn compute_array_value( &self, features: ArrayViewMut2<'_, TableValue<'_>>, column_a: TableColumnView<'_>, column_b: TableColumnView<'_>, progress: &impl Fn(), )
Trait Implementations§
Source§impl Clone for BagOfWordsCosineSimilarityFeatureGroup
impl Clone for BagOfWordsCosineSimilarityFeatureGroup
Source§fn clone(&self) -> BagOfWordsCosineSimilarityFeatureGroup
fn clone(&self) -> BagOfWordsCosineSimilarityFeatureGroup
Returns a copy 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 BagOfWordsCosineSimilarityFeatureGroup
impl RefUnwindSafe for BagOfWordsCosineSimilarityFeatureGroup
impl Send for BagOfWordsCosineSimilarityFeatureGroup
impl Sync for BagOfWordsCosineSimilarityFeatureGroup
impl Unpin for BagOfWordsCosineSimilarityFeatureGroup
impl UnwindSafe for BagOfWordsCosineSimilarityFeatureGroup
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more