Class OpenNLPNERecogniser

    • Field Detail

      • MODELS_DIR

        public static final java.lang.String MODELS_DIR
      • ORGANIZATION_FILE

        public static final java.lang.String ORGANIZATION_FILE
        See Also:
        Constant Field Values
      • NER_PERSON_MODEL

        public static final java.lang.String NER_PERSON_MODEL
      • NER_LOCATION_MODEL

        public static final java.lang.String NER_LOCATION_MODEL
      • NER_ORGANIZATION_MODEL

        public static final java.lang.String NER_ORGANIZATION_MODEL
      • NER_TIME_MODEL

        public static final java.lang.String NER_TIME_MODEL
      • NER_DATE_MODEL

        public static final java.lang.String NER_DATE_MODEL
      • NER_PERCENT_MODEL

        public static final java.lang.String NER_PERCENT_MODEL
      • NER_MONEY_MODEL

        public static final java.lang.String NER_MONEY_MODEL
      • DEFAULT_MODELS

        public static final java.util.Map<java.lang.String,​java.lang.String> DEFAULT_MODELS
    • Constructor Detail

      • OpenNLPNERecogniser

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

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

      • 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
        Returns:
        true if this recogniser is ready to recognise, false otherwise
      • getEntityTypes

        public java.util.Set<java.lang.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
        Returns:
        set of entity types/classes
      • recognise

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