Object

org.nlp4l.lucene.stats

TFIDF

Related Doc: package stats

Permalink

object TFIDF

Utility object to generate feature vectors representing documents/corpus weighted by tf-idf.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TFIDF
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def tfIdfVector(countMap: Map[String, Long], words: Set[String], tfMode: String, smthTerm: Double, idfMode: String, termBoosts: Map[String, Double], numDocs: Int, maxTF: Long, dfMap: Map[String, Long]): Seq[Double]

    Permalink
  17. def tfIdfVector(reader: IReader, field: String, docId: Int, words: Set[String] = Set.empty, tfMode: String = "n", a: Double = 0.4, idfMode: String = "t", termBoosts: Map[String, Double] = Map.empty): (Seq[String], Seq[Double])

    Permalink

    Generate tf-idf based feature vector from a document.

    Generate tf-idf based feature vector from a document.

    tf and idf calculations can be varied according to "tfMode" and "idfMode" parameters. See http://nlp.stanford.edu/IR-book/html/htmledition/variant-tf-idf-functions-1.html for theoretical backgrounds.

    In default, when tfMode and idfMode are not given, weight for each term is given by this basic tf-idf formula

    (tf) * log(N / df)

    where tf is term frequency of the term in given document, N is the total number of documents and df is document frequency for the term.

    reader

    the IReader instance

    field

    the field name for counting words

    docId

    the Lucene document id

    words

    the set of words(terms) considered as feature. All words(terms) will be taken as features if empty set is given.

    tfMode

    tf calculation mode. Expected values are "n" (normal), "l" (logarithm), "m" (maximum normalization), "b" (boolean), "L" (Log ave), "w" (sublinear weighted). The default value is "n"

    a

    the smoothing term for tfMode "m". The default value is 0.4.

    idfMode

    idf calculation mode. Expected values are "n" (no), "t" (idf), "p" (prob idf). The default value is "t"

    returns

    the Vector of words and the feature vector

  18. def tfIdfVectors(reader: IReader, field: String, docIds: List[Int], words: Set[String] = Set.empty, tfMode: String = "n", a: Double = 0.4, idfMode: String = "t", termBoosts: Map[String, Double] = Map.empty): (Seq[String], Stream[Seq[Double]])

    Permalink

    Generate tf-idf based feature vector from a document.

    Generate tf-idf based feature vector from a document.

    See also documentation for tfIdfVector().

    reader

    the IReader instance

    field

    the field name for counting words

    docIds

    the list of Lucene document id

    words

    the set of words(terms) considered as feature. All words(terms) will be taken as features if empty set is given.

    tfMode

    tf calculation mode. The default value is "n"

    a

    the smoothing term for tfMode "m". The default value is 0.4.

    idfMode

    idf calculation mode. The default value is "t"

    returns

    the pair of words and the feature vectors

  19. def tfVector(reader: IReader, field: String, docId: Int, words: Set[String] = Set.empty, tfMode: String = "n", termBoosts: Map[String, Double] = Map.empty): (Seq[String], Seq[Long])

    Permalink

    Generate simple tf based feature vector from a document.

    Generate simple tf based feature vector from a document.

    reader

    the IReader instance

    field

    the field name for counting words

    docId

    the Lucene document id

    words

    the set of words(terms) considered as feature. All words(terms) will be taken as features if empty set is given.

    returns

    the Vector of words and the feature vector

  20. def tfVectors(reader: IReader, field: String, docIds: List[Int], words: Set[String] = Set.empty, tfMode: String = "n", termBoosts: Map[String, Double] = Map.empty): (Seq[String], Stream[Seq[Long]])

    Permalink

    Generate simple tf based feature vector from specified documents.

    Generate simple tf based feature vector from specified documents.

    reader

    the IReader instance

    field

    the field name for counting words

    docIds

    the list of Lucene document id

    words

    the set of words(terms) considered as feature. All words(terms) will be taken as features if empty set is given.

    returns

    the pair of words and the feature vectors

  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped