com.johnsnowlabs.nlp.annotators.classifier.dl
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
Dropout coefficient (Default: 0.5f
)
Whether to output to annotators log folder (Default: false
)
Batch size (Default: 64
)
Tensorflow config Protobytes passed to the TF session
Dropout coefficient (Default: 0.5f
)
Whether to output to annotators log folder (Default: false
)
input annotations columns currently used
Column with label per each document
Learning Rate (Default: 5e-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
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: 5e-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
Batch size (Default: 64
)
Tensorflow config Protobytes passed to the TF session
Dropout coefficient (Default: 0.5f
)
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: 5e-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
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
)
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 ClassifierDL for generic Multi-class Text Classification.
ClassifierDL uses the state-of-the-art Universal Sentence Encoder as an input for text classifications. The ClassifierDL annotator uses a deep learning model (DNNs) we have built inside TensorFlow and supports up to 100 classes.
For instantiated/pretrained models, see ClassifierDLModel.
Notes:
inputCol
.For extended examples of usage, see the Spark NLP Workshop [1] [2] and the ClassifierDLTestSpec.
Example
In this example, the training data
"sentiment.csv"
has the form ofThen traning can be done like so:
SentimentDLApproach for sentiment analysis
MultiClassifierDLApproach for multi-class classification