pub enum SmoothingMethod {
None,
AddOne,
ExpDecay,
}Expand description
Smoothing strategy for sentence-level / sparse BLEU.
Corpus-level BLEU aggregates counts first and should generally use
SmoothingMethod::None.
Variants§
None
No smoothing (classic Papineni — geometric mean may go to 0).
AddOne
Add 1 to both numerator and denominator of each p_n.
This is Chen & Cherry 2014 method 2 (a.k.a. Laplace / Lidstone-1).
ExpDecay
Exponentially decaying smoothing (Chen & Cherry 2014 method 3).
When a modified precision is zero, fall back to 1 / (2^k · c) for
the k-th consecutive zero, where c is candidate length.
Trait Implementations§
Source§impl Clone for SmoothingMethod
impl Clone for SmoothingMethod
Source§fn clone(&self) -> SmoothingMethod
fn clone(&self) -> SmoothingMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SmoothingMethod
impl Debug for SmoothingMethod
Source§impl Default for SmoothingMethod
impl Default for SmoothingMethod
Source§fn default() -> SmoothingMethod
fn default() -> SmoothingMethod
Returns the “default value” for a type. Read more
Source§impl PartialEq for SmoothingMethod
impl PartialEq for SmoothingMethod
Source§fn eq(&self, other: &SmoothingMethod) -> bool
fn eq(&self, other: &SmoothingMethod) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SmoothingMethod
impl Eq for SmoothingMethod
impl StructuralPartialEq for SmoothingMethod
Auto Trait Implementations§
impl Freeze for SmoothingMethod
impl RefUnwindSafe for SmoothingMethod
impl Send for SmoothingMethod
impl Sync for SmoothingMethod
impl Unpin for SmoothingMethod
impl UnsafeUnpin for SmoothingMethod
impl UnwindSafe for SmoothingMethod
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