TFIDFData

Struct TFIDFData 

Source
pub struct TFIDFData<N = f32, K = String, E = DefaultTFIDFEngine>
where N: Num + Copy, E: TFIDFEngine<N, K>, K: Clone + Eq + Hash,
{ pub documents: IndexMap<KeyRc<K>, TFVector<N>>, pub token_dim_sample: Vec<Box<str>>, pub idf: Option<IDFVector>, /* private fields */ }
Expand description

Data structure for deserializing TFIDFVectorizer. This struct does not contain references, so it can be serialized. Use the into_tf_idf_vectorizer method to convert to TFIDFVectorizer.

Fields§

§documents: IndexMap<KeyRc<K>, TFVector<N>>

TF vectors for documents

§token_dim_sample: Vec<Box<str>>

Token dimension sample for TF vectors

§idf: Option<IDFVector>

IDF vector

Implementations§

Source§

impl<N, K, E> TFIDFData<N, K, E>
where N: Num + Copy + Into<f64> + Send + Sync, E: TFIDFEngine<N, K>, K: Clone + Send + Sync + Eq + Hash,

Source

pub fn into_tf_idf_vectorizer( self, corpus_ref: Arc<Corpus>, ) -> TFIDFVectorizer<N, K, E>

Convert TFIDFData into TFIDFVectorizer. corpus_ref is a reference to the corpus.

Trait Implementations§

Source§

impl<N, K, E> Debug for TFIDFData<N, K, E>
where N: Num + Copy + Debug, E: TFIDFEngine<N, K> + Debug, K: Clone + Eq + Hash + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, N, K, E> Deserialize<'de> for TFIDFData<N, K, E>
where N: Num + Copy + Deserialize<'de>, E: TFIDFEngine<N, K>, K: Clone + Eq + Hash + Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<N, K, E> Serialize for TFIDFData<N, K, E>
where N: Num + Copy + Serialize, E: TFIDFEngine<N, K>, K: Clone + Eq + Hash + Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<N, K, E> Freeze for TFIDFData<N, K, E>

§

impl<N, K, E> RefUnwindSafe for TFIDFData<N, K, E>

§

impl<N = f32, K = String, E = DefaultTFIDFEngine> !Send for TFIDFData<N, K, E>

§

impl<N = f32, K = String, E = DefaultTFIDFEngine> !Sync for TFIDFData<N, K, E>

§

impl<N, K, E> Unpin for TFIDFData<N, K, E>
where E: Unpin, N: Unpin,

§

impl<N, K, E> UnwindSafe for TFIDFData<N, K, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,