pub struct TrainOptions {
pub seed: String,
pub corpus: String,
pub char_def: String,
pub unk_def: String,
pub feature_def: String,
pub rewrite_def: String,
pub output: String,
pub lambda: Option<f64>,
pub max_iter: Option<u32>,
pub max_threads: Option<u32>,
}Expand description
Options for training a CRF model.
Fields§
§seed: StringPath to the seed lexicon file (CSV format).
corpus: StringPath to the annotated training corpus.
char_def: StringPath to the character definition file (char.def).
unk_def: StringPath to the unknown word definition file (unk.def).
feature_def: StringPath to the feature definition file (feature.def).
rewrite_def: StringPath to the rewrite rule definition file (rewrite.def).
output: StringOutput path for the trained model file.
lambda: Option<f64>L1 regularization cost (0.0-1.0, default: 0.01).
max_iter: Option<u32>Maximum number of training iterations (default: 100).
max_threads: Option<u32>Number of threads (undefined = auto-detect CPU cores).
Trait Implementations§
Source§impl FromNapiValue for TrainOptions
impl FromNapiValue for TrainOptions
Source§unsafe fn from_napi_value(
env: napi_env,
napi_val: napi_value,
) -> Result<TrainOptions>
unsafe fn from_napi_value( env: napi_env, napi_val: napi_value, ) -> Result<TrainOptions>
Safety Read more
fn from_unknown(value: Unknown<'_>) -> Result<Self, Error>
Source§impl ToNapiValue for TrainOptions
impl ToNapiValue for TrainOptions
Source§unsafe fn to_napi_value(env: napi_env, val: TrainOptions) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: TrainOptions) -> Result<napi_value>
Safety Read more
fn into_unknown(self, env: &Env) -> Result<Unknown<'_>, Error>
Source§impl TypeName for TrainOptions
impl TypeName for TrainOptions
Source§impl ValidateNapiValue for TrainOptions
impl ValidateNapiValue for TrainOptions
Source§unsafe fn validate(
env: *mut napi_env__,
napi_val: *mut napi_value__,
) -> Result<*mut napi_value__, Error>
unsafe fn validate( env: *mut napi_env__, napi_val: *mut napi_value__, ) -> Result<*mut napi_value__, Error>
Safety Read more
Auto Trait Implementations§
impl Freeze for TrainOptions
impl RefUnwindSafe for TrainOptions
impl Send for TrainOptions
impl Sync for TrainOptions
impl Unpin for TrainOptions
impl UnsafeUnpin for TrainOptions
impl UnwindSafe for TrainOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
impl<T> JsValuesTupleIntoVec for Twhere
T: ToNapiValue,
fn into_vec(self, env: *mut napi_env__) -> Result<Vec<*mut napi_value__>, Error>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.