pub struct Model<'a> { /* private fields */ }
Expand description
The CRF model
Implementations§
Source§impl<'a> Model<'a>
impl<'a> Model<'a>
Sourcepub fn new(buf: &'a [u8]) -> Result<Self>
pub fn new(buf: &'a [u8]) -> Result<Self>
Create an instance of a model object from a model in memory
Sourcepub fn num_labels(&self) -> u32
pub fn num_labels(&self) -> u32
Number of labels
Sourcepub fn to_label_id(&self, value: &str) -> Option<u32>
pub fn to_label_id(&self, value: &str) -> Option<u32>
Convert a label string to label ID
Sourcepub fn to_attr_id(&self, value: &str) -> Option<u32>
pub fn to_attr_id(&self, value: &str) -> Option<u32>
Convert a attribute string to attribute ID
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Model<'a>
impl<'a> RefUnwindSafe for Model<'a>
impl<'a> Send for Model<'a>
impl<'a> Sync for Model<'a>
impl<'a> Unpin for Model<'a>
impl<'a> UnwindSafe for Model<'a>
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