Struct tangram_features::bag_of_words::BagOfWordsFeatureGroup [−][src]
pub struct BagOfWordsFeatureGroup { pub source_column_name: String, pub strategy: BagOfWordsFeatureGroupStrategy, pub tokenizer: Tokenizer, pub ngram_types: FnvHashSet<NGramType>, pub ngrams: IndexMap<NGram, BagOfWordsFeatureGroupNGramEntry, FnvBuildHasher>, }
Expand description
A BagOfWordsFeatureGroup creates features for a text column using the Bag of Words method.
Fields
source_column_name: String
This is the name of the 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: TableColumnView<'_>,
progress: &impl Fn(u64)
) -> Vec<TableColumn>
pub fn compute_array_f32(
&self,
features: ArrayViewMut2<'_, f32>,
column: TableColumnView<'_>,
progress: &impl Fn()
)
pub fn compute_array_value(
&self,
features: ArrayViewMut2<'_, TableValue<'_>>,
column: TableColumnView<'_>,
progress: &impl Fn()
)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BagOfWordsFeatureGroup
impl Send for BagOfWordsFeatureGroup
impl Sync for BagOfWordsFeatureGroup
impl Unpin for BagOfWordsFeatureGroup
impl UnwindSafe for BagOfWordsFeatureGroup
Blanket Implementations
Mutably borrows from an owned value. Read more