Search in sources :

Example 1 with TextRankPostprocessRequest

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

the class TextRankProcedure method textRankPostprocess.

@Procedure(name = "ga.nlp.ml.textRank.postprocess", mode = Mode.WRITE)
@Description("TextRank post-processing procedure")
public Stream<SingleResult> textRankPostprocess(@Name("textRankRequest") Map<String, Object> textRankRequest) {
    try {
        TextRankPostprocessRequest request = TextRankPostprocessRequest.fromMap(textRankRequest);
        TextRankProcessor processor = (TextRankProcessor) getNLPManager().getExtension(TextRankProcessor.class);
        return Stream.of(processor.postprocess(request));
    } catch (Exception e) {
        LOG.error("ERROR in TextRank", e);
        throw new RuntimeException(e);
    }
}
Also used : TextRankPostprocessRequest(com.graphaware.nlp.dsl.request.TextRankPostprocessRequest) TextRankProcessor(com.graphaware.nlp.ml.textrank.TextRankProcessor) Description(org.neo4j.procedure.Description) Procedure(org.neo4j.procedure.Procedure)

Aggregations

TextRankPostprocessRequest (com.graphaware.nlp.dsl.request.TextRankPostprocessRequest)1 TextRankProcessor (com.graphaware.nlp.ml.textrank.TextRankProcessor)1 Description (org.neo4j.procedure.Description)1 Procedure (org.neo4j.procedure.Procedure)1