Naive Bayes classifier for use in Lua
https://luarocks.org/modules/leafo/lapis-bayes
This update has no functional differences but includes refactors to internal function calls. If you are using the documented interface in the README then no changes are necessary.
Removed increment_text
method from Categories
model -- The Categories model has no ties to any particular classifier anymore. A classier or tokenizer instance must be used to convert text to a list of words.
Categoires:increment_words
can also take an array of words, in addition to hash table format
Remove the lapis.bayes.tokenizer
module, which included a global instance of a tokenizer. Use a classifier or tokenizer directly to tokenize text. The tokenize_text
function previously available on this module is now the tokenize_text
method of any classifier.
Added new methods to BaseClassifier
class in lapis.bayes.classifiers.base
. The base classifier now has methods that mirror the functions provided in the lapis.bayes
module
find_word_classifications
method that can be used to override the query for looking up the word countsclassify_text
methodtokenize_text
methodAdd support for regconfig
option to the PostgresTextTokenizer
. Previously it was hard-coded to english
.
Updates to test suite
Full Changelog: https://github.com/leafo/lapis-bayes/compare/v1.2.0...v1.3.0
https://luarocks.org/modules/leafo/lapis-bayes
Full Changelog: https://github.com/leafo/lapis-bayes/compare/v1.1.0...v1.2.0
trim
function instead of custom oneThe dev version has been in production for quite some time now so I'm packaging a 1.0 release
Recent updates
insert on conflict update