use of com.graphaware.nlp.dsl.result.Word2VecModelResult in project neo4j-nlp by graphaware.
the class Word2VecProcedure method listModels.
@Procedure(name = "ga.nlp.ml.word2vec.listModels", mode = Mode.WRITE)
public Stream<Word2VecModelResult> listModels() {
Word2VecProcessor word2VecProcessor = (Word2VecProcessor) getNLPManager().getExtension(Word2VecProcessor.class);
Map<String, Word2VecIndexLookup> models = word2VecProcessor.getWord2VecModel().getModels();
List<Word2VecModelResult> results = new ArrayList<>();
models.keySet().forEach(s -> {
try {
results.add(new Word2VecModelResult(s, models.get(s).getStorePath(), models.get(s).countIndex()));
} catch (IOException e) {
//
}
});
return results.stream();
}
Aggregations