Class OpenNLPNERecogniser

All Implemented Interfaces:

public class OpenNLPNERecogniser extends Object implements NERecogniser
This implementation of NERecogniser chains an array of OpenNLPNameFinders for which NER models are available in classpath.

The following models are scanned during initialization via class loader.:

Entity TypePath
"PERSON" "ner-person.bin"
See Also:
  • Field Details

  • Constructor Details

    • OpenNLPNERecogniser

      public OpenNLPNERecogniser()
      Creates a default chain of Name finders using default OpenNLP recognizers
    • OpenNLPNERecogniser

      public OpenNLPNERecogniser(Map<String,String> models)
      Creates a chain of Named Entity recognisers
      models - map of entityType -> model path NOTE: the model path should be known to class loader.
  • Method Details

    • isAvailable

      public boolean isAvailable()
      Description copied from interface: NERecogniser
      checks if this Named Entity recogniser is available for service
      Specified by:
      isAvailable in interface NERecogniser
      true if this recogniser is ready to recognise, false otherwise
    • getEntityTypes

      public Set<String> getEntityTypes()
      Description copied from interface: NERecogniser
      gets a set of entity types whose names are recognisable by this
      Specified by:
      getEntityTypes in interface NERecogniser
      set of entity types/classes
    • recognise

      public Map<String,Set<String>> recognise(String text)
      Description copied from interface: NERecogniser
      call for name recognition action from text
      Specified by:
      recognise in interface NERecogniser
      text - text with possibly contains names
      map of entityType -> set of names