use of com.graphaware.nlp.dsl.request.ComputeVectorRequest in project neo4j-nlp by graphaware.
the class ComputeVectorProcedure method annotate.
@Procedure(name = "ga.nlp.vector.compute", mode = Mode.WRITE)
@Description("Compute vectors for input node and store vector in the property specified")
public Stream<NodeResult> annotate(@Name("computeVectorRequest") Map<String, Object> computeVectorRequest) {
try {
ComputeVectorRequest request = ComputeVectorRequest.fromMap(computeVectorRequest);
Node result = getNLPManager().computeVectorAndPersist(request);
return Stream.of(new NodeResult(result));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
Aggregations