tf_idf_vectorizer/utils/datastruct/vector/idf.rs
1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize, Clone)]
4pub struct IDFVector
5{
6 /// IDF Vector it is not sparse because it is mostly filled
7 pub idf_vec: Vec<f32>,
8 /// latest entropy
9 pub latest_entropy: u64,
10 /// document count
11 pub doc_num: u64,
12}
13
14impl IDFVector
15{
16 pub fn new() -> Self {
17 Self {
18 idf_vec: Vec::new(),
19 latest_entropy: 0,
20 doc_num: 0,
21 }
22 }
23}