MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / load

Method load

python/seldon/text/docsim.py:255–277  ·  view source on GitHub ↗

load models from folder Parameters ---------- folder : str location of models

(self,folder)

Source from the content-addressed store, hash-verified

253 fout.close()
254
255 def load(self,folder):
256 """
257 load models from folder
258
259 Parameters
260 ----------
261
262 folder : str
263 location of models
264 """
265 self.index = similarities.Similarity.load(folder+"/"+self.gensim_output_prefix)
266 self.index.output_prefix=folder+"/gensim_index"
267 self.index.check_moved()
268 self.index_annoy = annoy.AnnoyIndex(self.vec_size)
269 self.index_annoy.load(folder+"/"+self.annoy_output_prefix)
270 self.seq2meta = {}
271 self.id2meta = {}
272 with open(folder+"/"+self.meta_output_prefix) as f:
273 for line in f:
274 line = line.rstrip()
275 j = json.loads(line)
276 self.seq2meta[j['corpus_seq_id']] = j
277 self.id2meta[j['id']] = j
278
279 def _remove_query_doc(self,query_id,results):
280 transformed = []

Callers 12

check_confFunction · 0.45
create_schemaFunction · 0.45
create_schemaFunction · 0.45
check_confFunction · 0.45
test_sklearn_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45
load_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45
test_sklearn_pipelineMethod · 0.45

Calls

no outgoing calls

Tested by 7

test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36
test_sklearn_pipelineMethod · 0.36