SpacyHandler
self, model, prototype_data) SpacyHandler(
Handler class for creating VetiverModels with spacy.
Parameters
model :
-
a trained and fit spacy model
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
prototype :
-
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
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.
Returns
: prediction
-
Prediction from model