Packages

t

smile.nlp

Operators

trait Operators extends AnyRef

High level NLP operators.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Operators
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Operators to any2stringadd[Operators] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Operators, B)
    Implicit
    This member is added by an implicit conversion from Operators to ArrowAssoc[Operators] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def bigram(p: Double, minFreq: Int, text: String*): Array[BigramCollocation]

    Identify bigram collocations whose p-value is less than the given threshold.

    Identify bigram collocations whose p-value is less than the given threshold.

    p

    the p-value threshold

    minFreq

    the minimum frequency of collocation.

    text

    input text.

    returns

    significant bigram collocations in descending order of likelihood ratio.

  8. def bigram(k: Int, minFreq: Int, text: String*): Array[BigramCollocation]

    Identify bigram collocations (words that often appear consecutively) within corpora.

    Identify bigram collocations (words that often appear consecutively) within corpora. They may also be used to find other associations between word occurrences.

    Finding collocations requires first calculating the frequencies of words and their appearance in the context of other words. Often the collection of words will then requiring filtering to only retain useful content terms. Each n-gram of words may then be scored according to some association measure, in order to determine the relative likelihood of each n-gram being a collocation.

    k

    finds top k bigram.

    minFreq

    the minimum frequency of collocation.

    text

    input text.

    returns

    significant bigram collocations in descending order of likelihood ratio.

  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def corpus(text: Seq[String]): SimpleCorpus

    Creates an in-memory text corpus.

    Creates an in-memory text corpus.

    text

    a set of text.

  11. def df(terms: Array[String], corpus: Array[Map[String, Int]]): Array[Int]

    Returns the document frequencies, i.e.

    Returns the document frequencies, i.e. the number of documents that contain term.

    terms

    the token list used as features.

    corpus

    the training corpus.

    returns

    the array of document frequencies.

  12. def ensuring(cond: (Operators) ⇒ Boolean, msg: ⇒ Any): Operators
    Implicit
    This member is added by an implicit conversion from Operators to Ensuring[Operators] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (Operators) ⇒ Boolean): Operators
    Implicit
    This member is added by an implicit conversion from Operators to Ensuring[Operators] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): Operators
    Implicit
    This member is added by an implicit conversion from Operators to Ensuring[Operators] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): Operators
    Implicit
    This member is added by an implicit conversion from Operators to Ensuring[Operators] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Operators to StringFormat[Operators] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def ngram(maxNGramSize: Int, minFreq: Int, text: String*): Seq[Seq[NGram]]

    An Apiori-like algorithm to extract n-gram phrases.

    An Apiori-like algorithm to extract n-gram phrases.

    maxNGramSize

    The maximum length of n-gram

    minFreq

    The minimum frequency of n-gram in the sentences.

    text

    input text.

    returns

    An array of sets of n-grams. The i-th entry is the set of i-grams.

  25. final def notify(): Unit
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  27. def postag(sentence: Array[String]): Array[PennTreebankPOS]

    Part-of-speech taggers.

    Part-of-speech taggers.

    sentence

    a sentence that is already segmented to words.

    returns

    the pos tags.

  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def tfidf(bag: Array[Double], n: Int, df: Array[Int]): Array[Double]

    Converts a bag of words to a feature vector by TF-IDF, which is normalized to L2 norm 1.

    Converts a bag of words to a feature vector by TF-IDF, which is normalized to L2 norm 1.

    bag

    the bag-of-words feature vector of a document.

    n

    the number of documents in training corpus.

    df

    the number of documents containing the given term in the corpus.

    returns

    TF-IDF feature vector

  30. def tfidf(corpus: Array[Array[Double]]): Array[Array[Double]]

    Converts a corpus to TF-IDF feature vectors, which are normalized to L2 norm 1.

    Converts a corpus to TF-IDF feature vectors, which are normalized to L2 norm 1.

    corpus

    the corpus of documents in bag-of-words representation.

    returns

    a matrix of which each row is the TF-IDF feature vector.

  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. def vectorize(terms: Array[String], bag: Set[String]): Array[Int]

    Converts a binary bag of words to a sparse feature vector.

    Converts a binary bag of words to a sparse feature vector.

    terms

    the token list used as features.

    bag

    the bag of words.

    returns

    an integer vector, which elements are the indices of presented feature tokens in ascending order.

  33. def vectorize(terms: Array[String], bag: Map[String, Int]): Array[Double]

    Converts a bag of words to a feature vector.

    Converts a bag of words to a feature vector.

    terms

    the token list used as features.

    bag

    the bag of words.

    returns

    a vector of frequency of feature tokens in the bag.

  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. def [B](y: B): (Operators, B)
    Implicit
    This member is added by an implicit conversion from Operators to ArrowAssoc[Operators] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Operators to any2stringadd[Operators]

Inherited by implicit conversion StringFormat from Operators to StringFormat[Operators]

Inherited by implicit conversion Ensuring from Operators to Ensuring[Operators]

Inherited by implicit conversion ArrowAssoc from Operators to ArrowAssoc[Operators]

Ungrouped