Skip to main content

ScoreConfig

Struct ScoreConfig 

Source
pub struct ScoreConfig {
    pub w_pos: f32,
    pub w_bnd: f32,
    pub w_head: f32,
    pub w_gap: f32,
    pub w_span: f32,
    pub w_tail: f32,
    pub w_exact: f32,
    pub w_case: f32,
    pub sigma_base: f32,
    pub n_ref: f32,
    pub w_idf: f32,
    pub confidence_scale: f32,
}
Expand description

エネルギーモデルの重みと変換係数をまとめた設定です。

Fields§

§w_pos: f32

先頭から離れるほど増える位置コストの重みです。

§w_bnd: f32

境界度の高い位置へ引き寄せる重みです。

§w_head: f32

文字列先頭および basename 先頭を優遇する重みです。

§w_gap: f32

離れた文字を飛び越えるときのギャップコスト重みです。

§w_span: f32

スパンを候補長全体へ分散して抑える重みです。

§w_tail: f32

最後の一致より後ろに残る末尾長へのコスト重みです。

§w_exact: f32

候補全体と query が一致するときのボーナス重みです。

§w_case: f32

case-insensitive 一致で大小が異なる文字へのコスト重みです。

§sigma_base: f32

Gaussian 減衰の基準となる sigma です。

§n_ref: f32

sigma 適応で基準に使う候補長です。

§w_idf: f32

コーパス統計由来の IDF を効かせる重みです。

§confidence_scale: f32

energy から confidence へ写像するときのスケールです。

Implementations§

Source§

impl ScoreConfig

Source

pub fn sigma(&self, candidate_len: usize) -> f32

候補長に応じて適応させた sigma を返します。

Trait Implementations§

Source§

impl Clone for ScoreConfig

Source§

fn clone(&self) -> ScoreConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ScoreConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ScoreConfig

Source§

fn eq(&self, other: &ScoreConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ScoreConfig

Source§

impl StructuralPartialEq for ScoreConfig

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.