train

Function train 

Source
pub fn train(
    seed: &str,
    corpus: &str,
    char_def: &str,
    unk_def: &str,
    feature_def: &str,
    rewrite_def: &str,
    output: &str,
    lambda_: f64,
    max_iter: u64,
    max_threads: Option<usize>,
) -> PyResult<()>
Expand description

Trains a morphological analysis model from an annotated corpus.

§Arguments

  • seed - Seed lexicon file path (CSV format)
  • corpus - Training corpus file path (annotated text)
  • char_def - Character definition file path (char.def)
  • unk_def - Unknown word definition file path (unk.def)
  • feature_def - Feature definition file path (feature.def)
  • rewrite_def - Rewrite rule definition file path (rewrite.def)
  • output - Output model file path
  • lambda_ - L1 regularization (0.0-1.0), default: 0.01
  • max_iter - Maximum number of iterations, default: 100
  • max_threads - Maximum number of threads (None = auto-detect CPU cores)

§Returns

  • PyResult<()> - Returns Ok(()) on success