SpacyHandler

SpacyHandler(self, model, prototype_data)

Handler class for creating VetiverModels with spacy.

Parameters

Name Type Description Default
model a trained and fit spacy model required

Methods

Name Description
construct_prototype Create data prototype for a spacy model, which is one column of string data
handler_predict Generates method for /predict endpoint in VetiverAPI

construct_prototype

SpacyHandler.construct_prototype()

Create data prototype for a spacy model, which is one column of string data

Returns

Type Description
Input data prototype for spacy model

handler_predict

SpacyHandler.handler_predict(input_data, check_prototype)

Generates method for /predict endpoint in VetiverAPI

The handler_predict function executes at each API call. Use this function for calling predict() and any other tasks that must be executed at each API call.

Parameters

Name Type Description Default
input_data Test data. The SpacyHandler expects an input of a 1 column DataFrame with the same column names as the prototype data, or column name “text” if no prototype was given. required

Returns

Type Description
prediction Prediction from model