Batch size (Default: 64
)
ConfigProto from tensorflow, serialized into byte array.
ConfigProto from tensorflow, serialized into byte array. Get with config_proto.SerializeToString()
Trains TensorFlow model for multi-class text classification
Trains TensorFlow model for multi-class text classification
Whether to output to annotators log folder (Default: false
)
Batch size (Default: 64
)
Tensorflow config Protobytes passed to the TF session
Whether to output to annotators log folder (Default: false
)
input annotations columns currently used
Column with label per each document
Learning Rate (Default: 1e-3f
)
Maximum number of epochs to train (Default: 10
)
Gets annotation column name going to generate
Gets annotation column name going to generate
Folder path to save training logs (Default: ""
)
Random seed
Max sequence length to feed into TensorFlow
The minimum threshold for each label to be accepted (Default: 0.5f
)
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
The value should be between 0.0 and 1.0 and by default it is 0.0 and off.
Input annotator type : SENTENCE_EMBEDDINGS
Input annotator type : SENTENCE_EMBEDDINGS
columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified
columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified
Column with label per each document
Learning Rate (Default: 1e-3f
)
Maximum number of epochs to train (Default: 10
)
Output annotator type : CATEGORY
Output annotator type : CATEGORY
Folder path to save training logs (Default: ""
)
Random seed for shuffling the dataset (Default: 44
)
Batch size (Default: 64
)
Tensorflow config Protobytes passed to the TF session
Whether to output to annotators log folder (Default: false
)
Overrides required annotators column if different than default
Overrides required annotators column if different than default
Column with label per each document
Learning Rate (Default: 1e-3f
)
Maximum number of epochs to train (Default: 10
)
Overrides annotation column name when transforming
Overrides annotation column name when transforming
Folder path to save training logs (Default: ""
)
Random seed
shufflePerEpoch
The minimum threshold for each label to be accepted (Default: 0.5f
)
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
The value should be between 0.0 and 1.0 and by default it is 0.0 and off.
Level of verbosity during training (Default: Verbose.Silent.id
)
Level of verbosity during training (Default: Verbose.Silent.id
)
Whether to shuffle the training data on each Epoch (Default: false
)
The minimum threshold for each label to be accepted (Default: 0.5f
)
requirement for pipeline transformation validation.
requirement for pipeline transformation validation. It is called on fit()
takes a Dataset and checks to see if all the required annotation types are present.
takes a Dataset and checks to see if all the required annotation types are present.
to be validated
True if all the required types are present, else false
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
Choose the proportion of training dataset to be validated against the model on each Epoch (Default: 0.0f
).
The value should be between 0.0 and 1.0 and by default it is 0.0 and off.
Level of verbosity during training (Default: Verbose.Silent.id
)
A list of (hyper-)parameter keys this annotator can take. Users can set and get the parameter values through setters and getters, respectively.
Required input and expected output annotator types
Trains a MultiClassifierDL for Multi-label Text Classification.
MultiClassifierDL uses a Bidirectional GRU with a convolutional model that we have built inside TensorFlow and supports up to 100 classes.
For instantiated/pretrained models, see MultiClassifierDLModel.
The input to
MultiClassifierDL
are Sentence Embeddings such as the state-of-the-art UniversalSentenceEncoder, BertSentenceEmbeddings, or SentenceEmbeddings.In machine learning, multi-label classification and the strongly related problem of multi-output classification are variants of the classification problem where multiple labels may be assigned to each instance. Multi-label classification is a generalization of multiclass classification, which is the single-label problem of categorizing instances into precisely one of more than two classes; in the multi-label problem there is no constraint on how many of the classes the instance can be assigned to. Formally, multi-label classification is the problem of finding a model that maps inputs x to binary vectors y (assigning a value of 0 or 1 for each element (label) in y).
Notes:
inputCol
.For extended examples of usage, see the Spark NLP Workshop and the MultiClassifierDLTestSpec.
Example
In this example, the training data has the form (Note: labels can be arbitrary)
It needs some pre-processing first, so the labels are of type
Array[String]
. This can be done like so:SentimentDLApproach for sentiment analysis
ClassifierDLApproach for single-class classification
Multi-label classification on Wikipedia