nessie.models.text.fasttext_text_classifier

Module Contents

Classes

FastTextTextClassifier

Helper class that provides a standard way to create an ABC using

class nessie.models.text.fasttext_text_classifier.FastTextTextClassifier(verbose: bool = False)

Bases: nessie.models.TextClassifier

Helper class that provides a standard way to create an ABC using inheritance.

fit(self, X: nessie.types.StringArray, y: nessie.types.StringArray)
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