pub struct IbmModel1 {
pub t_fe: Array2<f64>,
pub t_0e: Array1<f64>,
}Expand description
IBM Model 1.
Fields§
§t_fe: Array2<f64>Translation probability from source word f to target word e.
t_fe[(f, e)] = Pr(e|f)
Shape: (|source_vocab|, |target_vocab|)
t_0e: Array1<f64>Translation probability from null word to target word e.
t_e0[e] = Pr(e|NULL)
Shape: (|target_vocab|,)
Implementations§
Trait Implementations§
Source§impl Model for IbmModel1
impl Model for IbmModel1
Source§fn make_viterbi_alignment(&self, pair: &SentencePair) -> Alignment
fn make_viterbi_alignment(&self, pair: &SentencePair) -> Alignment
Generates Viterbi alignment for given sentence pair.
Source§impl Save for IbmModel1
impl Save for IbmModel1
Source§fn save(&self, writer: &mut impl Write) -> Result<()>
fn save(&self, writer: &mut impl Write) -> Result<()>
§File format
f_size:u32e_size:u32t_fe:[f64; f_size * e_size]t_0e:[f64; e_size]
All values are of little endian.
t_fe and t_0e are stored in row-major ascending order.
t_fe:[(0, 0)], [(0, 1)]..., [(0, el-1)], [(1, 0)], ...t_0e:[0], [1], ...
Auto Trait Implementations§
impl Freeze for IbmModel1
impl RefUnwindSafe for IbmModel1
impl Send for IbmModel1
impl Sync for IbmModel1
impl Unpin for IbmModel1
impl UnsafeUnpin for IbmModel1
impl UnwindSafe for IbmModel1
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