Override this method to define a model.
Override this method to define a model.
The number of text categories to be classified.
The number of text categories to be classified. Positive integer.
The encoder for input sequences.
The encoder for input sequences. String. "cnn" or "lstm" or "gru" are supported. Default is "cnn".
The output dimension for the encoder.
The output dimension for the encoder. Positive integer. Default is 256.
The defined model, either from buildModel() or loaded from file.
The defined model, either from buildModel() or loaded from file.
Predict for classes.
Predict for classes. By default, label predictions start from 0.
Prediction data, RDD of Sample.
Number of samples per batch. Default is 32.
Boolean. Whether result labels start from 0. Default is true. If false, result labels start from 1.
Save the model to the specified path.
Save the model to the specified path.
The path to save the model. Local file system, HDFS and Amazon S3 are supported. HDFS path should be like "hdfs://[host]:[port]/xxx". Amazon S3 path should be like "s3a://bucket/xxx".
The path to save weights. Default is null.
Whether to overwrite the file if it already exists. Default is false.
The length of a sequence.
The length of a sequence. Positive integer. Default is 500.
Print out the summary of the model.
Print out the summary of the model.
The size of each word vector.
The size of each word vector. Positive integer.
(Since version 0.3.0) please use recommended saveModule(path, overWrite)
The model used for text classification.
Numeric type of parameter(e.g. weight, bias). Only support float/double now.