Finetune Quickstart GuideΒΆ

Finetuning the base language model is as easy as calling Classifier.fit():

model = Classifier()               # Load base model
model.fit(trainX, trainY)          # Finetune base model on custom data
predictions= model.predict(testX)  # ['class_2', 'class_1', 'class_3'...]
probs = model.predict_proba(testX) # [{'class_1': 0.23, 'class_2': 0.54, ..}, ..]
model.save(path)                   # Serialize the model to disk

Reload saved models from disk by using Classifier.load():

model = Classifier.load(path)
predictions = model.predict(testX)