NGram (Spark 3.5.5 JavaDoc) (original) (raw)


public class NGram
extends UnaryTransformer<scala.collection.Seq,scala.collection.Seq,NGram>
implements DefaultParamsWritable
A feature transformer that converts the input array of strings into an array of n-grams. Null values in the input array are ignored. It returns an array of n-grams where each n-gram is represented by a space-separated string of words.
When the input is empty, an empty array is returned. When the input array length is less than n (number of elements per n-gram), no n-grams are returned.
See Also:
Serialized Form