nodes.nlp

WordFrequencyTransformer

class WordFrequencyTransformer extends Transformer[Seq[String], Seq[Int]]

Encodes string tokens as non-negative integers, which are indices of the tokens' positions in the sorted-by-frequency order. Out-of-vocabulary words are mapped to the special index -1.

The parameters passed to this class are usually calculated by WordFrequencyEncoder.

Linear Supertypes
Transformer[Seq[String], Seq[Int]], Pipeline[Seq[String], Seq[Int]], TransformerNode[Seq[Int]], Serializable, Serializable, Node, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WordFrequencyTransformer
  2. Transformer
  3. Pipeline
  4. TransformerNode
  5. Serializable
  6. Serializable
  7. Node
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WordFrequencyTransformer(wordIndexBroadcast: Broadcast[Map[String, Int]], unigramCounts: Map[Int, Int])

    wordIndexBroadcast

    A mapping from token string to its frequency-ordered index

    unigramCounts

    the counts of unigrams in the training corpus

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final val OOV_INDEX: Int(-1)

  7. final def andThen[C, L](est: LabelEstimator[Seq[Int], C, L], data: RDD[Seq[String]], labels: RDD[L]): PipelineWithFittedTransformer[Seq[String], Seq[Int], C]

    Definition Classes
    Pipeline
  8. final def andThen[C](est: Estimator[Seq[Int], C], data: RDD[Seq[String]]): PipelineWithFittedTransformer[Seq[String], Seq[Int], C]

    Definition Classes
    Pipeline
  9. final def andThen[C](next: Pipeline[Seq[Int], C]): Pipeline[Seq[String], C]

    Chains a pipeline onto the end of this one, producing a new pipeline.

    Chains a pipeline onto the end of this one, producing a new pipeline.

    next

    the pipeline to chain

    Definition Classes
    Pipeline
  10. def apply(words: Seq[String]): Seq[Int]

    Apply this Transformer to a single input item

    Apply this Transformer to a single input item

    returns

    The output value

    Definition Classes
    WordFrequencyTransformerTransformerPipeline
  11. def apply(in: RDD[Seq[String]]): RDD[Seq[Int]]

    Apply this Transformer to an RDD of input items

    Apply this Transformer to an RDD of input items

    in

    The bulk RDD input to pass into this transformer

    returns

    The bulk RDD output for the given input

    Definition Classes
    WordFrequencyTransformerTransformerPipeline
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def clone(): AnyRef

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

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

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

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

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

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

    Definition Classes
    Any
  20. def label: String

    Definition Classes
    Node
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

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

    Definition Classes
    AnyRef
  25. final def toDOTString: String

    returns

    A graphviz dot representation of this pipeline

    Definition Classes
    Pipeline
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. val unigramCounts: Map[Int, Int]

    the counts of unigrams in the training corpus

  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Transformer[Seq[String], Seq[Int]]

Inherited from Pipeline[Seq[String], Seq[Int]]

Inherited from TransformerNode[Seq[Int]]

Inherited from Serializable

Inherited from Serializable

Inherited from Node

Inherited from AnyRef

Inherited from Any

Ungrouped