Struct tangram_features::bag_of_words_cosine_similarity::BagOfWordsCosineSimilarityFeatureGroup [−][src]
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
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
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more