17.7.11 Loading a Pre-Trained Pg2vec Model
You can load models from a database.
You can load a pre-trained Pg2vec model from a model store table in database as described in the following:
opg4j> var model = analyst.loadPg2vecModel().db().
modelstore("modeltablename"). // name of the model store table
modelname("model"). // model name (primary key of model store table)
load()
Pg2vecModel model = analyst.loadPg2vecModel().db()
.modelstore("modeltablename") // name of the model store table
.modelname("model") // model name (primary key of model store table)
.load();
model = analyst.get_pg2vec_model_loader(). \
db(model_store="modelstoretablename", # name of the model store table
model_name="model") # model name (primary key of model store table)
Note:
All the preceding examples assume that you are loading the model from the current logged in database. If you must load the model from a different database then refer to the examples in Loading a Pre-Trained Model From Another Database.Parent topic: Using the Pg2vec Algorithm