Search in sources :

Example 1 with CustomModelsRequest

use of com.graphaware.nlp.dsl.request.CustomModelsRequest in project neo4j-nlp by graphaware.

the class TextProcessorsProcedure method test.

@Procedure(name = "ga.nlp.processor.test", mode = Mode.WRITE)
@Description("Procedure for testing custom models.")
public Stream<SingleResult> test(@Name("customModelsRequest") Map<String, Object> customModelsRequest) {
    try {
        CustomModelsRequest request = CustomModelsRequest.fromMap(customModelsRequest);
        Object result = getNLPManager().test(request);
        return Stream.of(new SingleResult(result));
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : SingleResult(com.graphaware.nlp.dsl.result.SingleResult) CustomModelsRequest(com.graphaware.nlp.dsl.request.CustomModelsRequest) Description(org.neo4j.procedure.Description) Procedure(org.neo4j.procedure.Procedure)

Example 2 with CustomModelsRequest

use of com.graphaware.nlp.dsl.request.CustomModelsRequest in project neo4j-nlp by graphaware.

the class TextProcessorsProcedure method train.

@Procedure(name = "ga.nlp.processor.train", mode = Mode.WRITE)
@Description("Procedure for training custom models.")
public Stream<SingleResult> train(@Name("customModelsRequest") Map<String, Object> customModelsRequest) {
    try {
        CustomModelsRequest request = CustomModelsRequest.fromMap(customModelsRequest);
        Object result = getNLPManager().train(request);
        return Stream.of(new SingleResult(result));
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : SingleResult(com.graphaware.nlp.dsl.result.SingleResult) CustomModelsRequest(com.graphaware.nlp.dsl.request.CustomModelsRequest) Description(org.neo4j.procedure.Description) Procedure(org.neo4j.procedure.Procedure)

Aggregations

CustomModelsRequest (com.graphaware.nlp.dsl.request.CustomModelsRequest)2 SingleResult (com.graphaware.nlp.dsl.result.SingleResult)2 Description (org.neo4j.procedure.Description)2 Procedure (org.neo4j.procedure.Procedure)2