Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SimpleNaiveBayesClassifier

    A simplistic Lucene based NaiveBayes classifier, see

    http://en.wikipedia.org/wiki/Naive_Bayes_classifier

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    SimpleNaiveBayesClassifier
    Implements
    IClassifier<Lucene.Net.Util.BytesRef>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Classification
    Assembly: Lucene.Net.Classification.dll
    Syntax
    public class SimpleNaiveBayesClassifier : IClassifier<BytesRef>

    Constructors

    | Improve this Doc View Source

    SimpleNaiveBayesClassifier()

    Creates a new NaiveBayes classifier. Note that you must call Train(AtomicReader, String, String, Analyzer) before you can classify any documents.

    Declaration
    public SimpleNaiveBayesClassifier()

    Methods

    | Improve this Doc View Source

    AssignClass(String)

    Assign a class (with score) to the given text string

    Declaration
    public virtual ClassificationResult<BytesRef> AssignClass(string inputDocument)
    Parameters
    Type Name Description
    System.String inputDocument

    a string containing text to be classified

    Returns
    Type Description
    ClassificationResult<Lucene.Net.Util.BytesRef>

    a ClassificationResult<T> holding assigned class of type Lucene.Net.Util.BytesRef and score

    | Improve this Doc View Source

    Train(AtomicReader, String, String, Analyzer)

    Train the classifier using the underlying Lucene index

    Declaration
    public virtual void Train(AtomicReader atomicReader, string textFieldName, string classFieldName, Analyzer analyzer)
    Parameters
    Type Name Description
    Lucene.Net.Index.AtomicReader atomicReader

    the reader to use to access the Lucene index

    System.String textFieldName

    the name of the field used to compare documents

    System.String classFieldName

    the name of the field containing the class assigned to documents

    Lucene.Net.Analysis.Analyzer analyzer

    the analyzer used to tokenize / filter the unseen text

    | Improve this Doc View Source

    Train(AtomicReader, String, String, Analyzer, Query)

    Train the classifier using the underlying Lucene index

    Declaration
    public virtual void Train(AtomicReader atomicReader, string textFieldName, string classFieldName, Analyzer analyzer, Query query)
    Parameters
    Type Name Description
    Lucene.Net.Index.AtomicReader atomicReader

    the reader to use to access the Lucene index

    System.String textFieldName

    the name of the field used to compare documents

    System.String classFieldName

    the name of the field containing the class assigned to documents

    Lucene.Net.Analysis.Analyzer analyzer

    the analyzer used to tokenize / filter the unseen text

    Lucene.Net.Search.Query query

    the query to filter which documents use for training

    | Improve this Doc View Source

    Train(AtomicReader, String[], String, Analyzer, Query)

    Train the classifier using the underlying Lucene index

    Declaration
    public virtual void Train(AtomicReader atomicReader, string[] textFieldNames, string classFieldName, Analyzer analyzer, Query query)
    Parameters
    Type Name Description
    Lucene.Net.Index.AtomicReader atomicReader

    the reader to use to access the Lucene index

    System.String[] textFieldNames

    the names of the fields to be used to compare documents

    System.String classFieldName

    the name of the field containing the class assigned to documents

    Lucene.Net.Analysis.Analyzer analyzer

    the analyzer used to tokenize / filter the unseen text

    Lucene.Net.Search.Query query

    the query to filter which documents use for training

    Implements

    IClassifier<T>
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.