public Map<String, Set<String>> recognise(String text) {
        Map<String, Set<String>> entities = new HashMap<>();
        try {
            String url = restHostUrlStr + "/nltk";
            Response response = WebClient.create(url).accept(MediaType.TEXT_HTML).post(text);
            int responseCode = response.getStatus();
            if (responseCode == 200) {
                String result = response.readEntity(String.class);
                JSONParser parser = new JSONParser();
                JSONObject j = (JSONObject) parser.parse(result);
                for (Object o : j.keySet()) {
                    String key = (String) o;
                    if (!key.equals("result")) {
                        ENTITY_TYPES.add(key);
                        entities.put(key.toUpperCase(Locale.ENGLISH),
                                new HashSet((Collection) j.get(key)));
                    }
                }
            }
        } catch (Exception e) {
            LOG.debug(e.getMessage(), e);
        }

        return entities;
    }
recognises names of entities in the text

@param text text which possibly contains names
@return map of entity type -&gt; set of names
tika-parsers/tika-parsers-ml/tika-parser-nlp-module/src/main/java/org/apache/tika/parser/ner/nltk/NLTKNERecogniser.java