nessie.models.text.flair_text_classifier
Module Contents
Classes
Helper class that provides a standard way to create an ABC using |
- class nessie.models.text.flair_text_classifier.FlairTextClassifier(verbose: bool = True, max_epochs: int = 150, batch_size: int = 64)
Bases:
nessie.models.TextClassifier
Helper class that provides a standard way to create an ABC using inheritance.
- LABEL_TYPE = class
- fit(self, X: nessie.types.StringArray, y: nessie.types.StringArray)
- has_dropout(self) bool
- label_encoder(self) sklearn.preprocessing.LabelEncoder
Returns a label encoder that can be used to map labels to ints and vice versa
- predict(self, X: nessie.types.StringArray) numpy.typing.NDArray[str]
- predict_proba(self, X: nessie.types.StringArray) numpy.typing.NDArray[float]
Returns a distribution over labels for each instance.
- Parameters
X – The texts to predict on
- Returns
A (num_instances, num_labels) numpy array
- score(self, X: nessie.types.StringArray) numpy.typing.NDArray[float]
Returns the best score for each item
- use_dropout(self, is_activated: bool)