pub struct Config {
pub ngrams: usize,
pub punctuation: HashSet<char>,
pub window_size: usize,
pub strict_capital: bool,
pub only_alphanumeric_and_hyphen: bool,
pub minimum_chars: usize,
pub remove_duplicates: bool,
pub deduplication_threshold: f64,
}Expand description
Fine-tunes keyword extraction.
Fields§
§ngrams: usizeHow many words a key phrase may contain.
n-gram is a contiguous sequence of n words occurring in the text.
punctuation: HashSet<char>List of punctuation symbols.
They are known as exclude chars in the original implementation.
window_size: usizeThe number of tokens both preceding and following a term to calculate term dispersion metric.
strict_capital: boolWhen true, calculate term casing metric by counting capitalized terms without
intermediate uppercase letters. Thus, Paypal is counted while PayPal is not.
The original implementation sticks with true.
only_alphanumeric_and_hyphen: boolWhen true, key phrases are allowed to have only alphanumeric characters and hyphen.
minimum_chars: usizeKey phrases can’t be too short, less than minimum_chars in total.
remove_duplicates: boolWhen true, similar key phrases are deduplicated.
Key phrases are considered similar if their Levenshtein distance is greater than
deduplication_threshold.
deduplication_threshold: f64A threshold in range 0..1. Equal strings have the distance equal to 1.
Effective only when remove_duplicates is true.
Trait Implementations§
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more