[docs]deffeaturize(self,X):""" Embeds inputs in learned feature space. Can be called before or after calling :meth:`finetune`. :param X: list or array of text to embed. :returns: np.array of features of shape (n_examples, embedding_size). """returnsuper().featurize(X)

[docs]defpredict(self,X,threshold=None):""" Produces a list of most likely class labels as determined by the fine-tuned model. :param X: list or array of text to embed. :returns: list of class labels. """self.config._threshold=thresholdorself.config.multi_label_thresholdreturnself._predict(X)

[docs]defpredict_proba(self,X):""" Produces a probability distribution over classes for each example in X. :param X: list or array of text to embed. :returns: list of dictionaries. Each dictionary maps from a class label to its assigned class probability. """returnsuper().predict_proba(X)

[docs]deffinetune(self,X,Y=None,batch_size=None):""" :param X: list or array of text. :param Y: A list of lists containing labels for the corresponding X :param batch_size: integer number of examples per batch. When N_GPUS > 1, this number corresponds to the number of training examples provided to each GPU. """returnsuper().finetune(X,Y=Y,batch_size=batch_size)