Repository navigation
v1.5.0 - Saturation Trainer
https://luarocks.org/modules/leafo/lapis-bayes
Added
SaturationTrainer(lapis.bayes.trainers.saturation): The first trainer class that selects candidate tokens based on the categories they will be trained for. Saturation trainer attempts to avoid over-training tokens by skipping tokens that pass the confidence threshold. Can be configured withsaturation_threshold,min_observations,train_novel, andtrain_opposite.lapis.bayes.tokenizers.util: shared helpers for cleaning up tokens, includingsanitize_token,sanitize_tokens, andnormalize_url_text.stopwordslist added toSpamTokenizer, unigram tokens that are in the stopwords list are now dropped by default.lapis.bayes.text.utf8now also exposes thevariation_selector,zero_width_joiner, andflag_tag_sequencepatterns.
Changed
- Word selection in
candidate_wordsnow ranks words by how strongly each word is tied to a category using a chi-squared scoring system. Ties are broken alphabetically for deterministic output. - Removing invisible characters no longer breaks emoji and other multi part characters. Emoji built from several joined parts, flag emoji, keycap characters, and accented or combined characters are kept whole, while stray invisible characters are still removed.
SpamTokenizer,PostgresTextTokenizer, andUrlDomainsTokenizernow clean up their tokens at the end, removing invisible characters and dropping anything left empty. Tokens should never have mixed in invisible Unicode characters now.- URLs are now decoded before they are read, so links that hide their address with percent encoding are still picked up.
Full Changelog: v1.4.0...v1.5.0