pub struct Keyword {
pub word: String,
pub score: f32,
pub count: usize,
}Expand description
A keyword extracted from a document with its relevance score.
Scores are computed as TF × IDF_proxy:
- TF: how often the word appears in this document (normalized by total content tokens)
- IDF_proxy:
(max_tnc_freq + 1) / (tnc_freq + 1)— rare corpus words receive a higher weight than common function words
Keywords are returned sorted by score descending.
Fields§
§word: StringThe word text.
score: f32TF × IDF_proxy score. Higher means more document-distinctive.
count: usizeRaw occurrence count of this word in the document.
Trait Implementations§
impl StructuralPartialEq for Keyword
Auto Trait Implementations§
impl Freeze for Keyword
impl RefUnwindSafe for Keyword
impl Send for Keyword
impl Sync for Keyword
impl Unpin for Keyword
impl UnsafeUnpin for Keyword
impl UnwindSafe for Keyword
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