Description Usage Format Details Usage Methods Author(s) Examples
a R6 class of naive Bayes classifier.
1 |
R6Class
object.
A R6class of naive Bayes classifier .
For usage details see Methods, Arguments and Examples sections.
1 2 3 4 5 | naiveBayes = hanlp.naiveBayesClassify$new()
naiveBayes$train(file_folder)
naiveBayes$predict(text)
naiveBayes$test(test_data)
naiveBayes$getModel()
|
$new()
Constructor for Naive Bayes classifier.
$train(file_folder)
Train Naive Bayes classifier,detail in https://github.com/hankcs/HanLP/wiki .
$predict(text)
Predict text
category.
$test(test_data)
Predict a batch of text categories,test_data
is a character vector.
$getModel()
Output some infomation of Naive Bayes model.
qxde01
1 2 3 4 5 6 7 8 | ## Not run:
naiveBayes = hanlp.naiveBayesClassify$new()
naiveBayes$train(file_folder)
naiveBayes$predict(text)
naiveBayes$test(test_data)
naiveBayes$getModel()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.