use of com.graphaware.nlp.enrich.Enricher in project neo4j-nlp by graphaware.
the class EnrichConceptProcedure method annotate.
@Procedure(name = "ga.nlp.enrich.concept", mode = Mode.WRITE)
@Description("Enrich knowledge concepts by consulting external knowledge bases like ConceptNet5 or Microsoft Concept Graphs")
public Stream<NodeResult> annotate(@Name("conceptRequest") Map<String, Object> conceptRequest) {
ConceptRequest request = ConceptRequest.fromMap(conceptRequest);
Enricher enricher = getNLPManager().getEnricher(request.getEnricherName());
Node result = enricher.importConcept(request);
return Stream.of(new NodeResult(result));
}
use of com.graphaware.nlp.enrich.Enricher in project neo4j-nlp by graphaware.
the class EnrichConceptProcedure method list.
@Procedure(name = "ga.nlp.enrichers.list", mode = Mode.READ)
@Description("List enrichers available")
public Stream<EnricherList> list() {
Map<String, Enricher> enrichers = getNLPManager().getEnrichmentRegistry().getEnrichers();
List<EnricherList> list = new ArrayList<>();
enrichers.values().forEach(e -> {
list.add(new EnricherList(e.getName(), e.getAlias()));
});
return list.stream();
}
Aggregations