Enum BleuSmoothing
pub enum BleuSmoothing {
None,
AddEpsilon(f64),
Exponential,
}Expand description
Smoothing method for BLEU score computation.
Sentence-level BLEU often produces zero scores when higher-order n-grams have no matches. Smoothing techniques address this by assigning small non-zero values to zero-count precisions.
§References
Chen & Cherry, “A Systematic Comparison of Smoothing Techniques for Sentence-Level BLEU”, WMT 2014.
Variants§
None
No smoothing. Zero precision at any n-gram order produces a zero overall score (standard corpus-level BLEU behaviour).
AddEpsilon(f64)
Add a small constant (epsilon, default 0.1) to zero-count
precisions. Corresponds to method 1 in Chen & Cherry (2014).
Exponential
Exponential decay: for each n-gram order with zero matches, double a
running multiplier k (starting at 1 and doubling on every zero) and
replace the precision with 1 / (k * total_n). Corresponds to
method 3 in Chen & Cherry (2014) and the default smoothing in
SacreBLEU for sentence-level BLEU.
Trait Implementations§
§impl Clone for BleuSmoothing
impl Clone for BleuSmoothing
§fn clone(&self) -> BleuSmoothing
fn clone(&self) -> BleuSmoothing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for BleuSmoothing
impl Debug for BleuSmoothing
§impl Default for BleuSmoothing
impl Default for BleuSmoothing
§fn default() -> BleuSmoothing
fn default() -> BleuSmoothing
Auto Trait Implementations§
impl Freeze for BleuSmoothing
impl RefUnwindSafe for BleuSmoothing
impl Send for BleuSmoothing
impl Sync for BleuSmoothing
impl Unpin for BleuSmoothing
impl UnsafeUnpin for BleuSmoothing
impl UnwindSafe for BleuSmoothing
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().