The implementation between each model can be entire different, we are not going to go into details about each particular model, each model implementation in Python Bridge is a set of expected functions focus in functionality
def initialize(self, model_dir, **kwargs):
Receive the path to the model type and the configuration for the path
def load(self, model_dir, name, version):
Receive the path to the model type, the name of the model and the version of it, in this section the loading of the model is expected
def save(self):
Save the current loaded model
def clear(self):
Remove the current loaded model, and any training data in memory
def feed(self, data):
Receives a list of string tokens tokens to be added to the training data
def train(self, **kwargs):
Trains model with the fed documents, the model can be either kept in memory or saved
def predict(self, data: list):
Retrieves a vector or an array of vectors, from processing the data with the loaded mode, which is return inside a JSON { 'vector': [ ] }, the value of the vector key must be always be an array.
def regress(self, data):
??
def classify(self, data) -> (str, float):
Retrieves a label or multiple labels, using the loaded model, from the data. We recommend returning the label along with its confidence.