Class SimpleNaiveBayesDocumentClassifier

    • Field Detail

    • Constructor Detail

      • SimpleNaiveBayesDocumentClassifier

        public SimpleNaiveBayesDocumentClassifier​(IndexReader indexReader,
                                                  Query query,
                                                  String classFieldName,
                                                  Map<String,​Analyzer> field2analyzer,
                                                  String... textFieldNames)
        Creates a new NaiveBayes classifier.
        Parameters:
        indexReader - the reader on the index to be used for classification
        query - a Query to eventually filter the docs used for training the classifier, or null if all the indexed docs should be used
        classFieldName - the name of the field used as the output for the classifier NOTE: must not be heavely analyzed as the returned class will be a token indexed for this field
        textFieldNames - the name of the fields used as the inputs for the classifier, they can contain boosting indication e.g. title^10