use of com.graphaware.nlp.dsl.request.AnnotationRequest in project neo4j-nlp by graphaware.
the class AnnotateProcedure method annotate.
@Procedure(name = "ga.nlp.annotate", mode = Mode.WRITE)
@Description("Performs the text annotation and store it into the graph")
public Stream<NodeResult> annotate(@Name("annotationRequest") Map<String, Object> annotationRequest) {
try {
AnnotationRequest request = AnnotationRequest.fromMap(annotationRequest);
Node result = getNLPManager().annotateTextAndPersist(request);
return Stream.of(new NodeResult(result));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
Aggregations