Class MITIENERecogniser

  • All Implemented Interfaces:
    NERecogniser

    public class MITIENERecogniser
    extends java.lang.Object
    implements NERecogniser
    This class offers an implementation of NERecogniser based on trained models using state-of-the-art information extraction tools. This NER requires additional setup, due to runtime binding to MIT Information Extraction. See Tika MITIE Wiki for configuring this recogniser.
    See Also:
    NERecogniser
    • Constructor Summary

      Constructors 
      Constructor Description
      MITIENERecogniser()  
      MITIENERecogniser​(java.lang.String modelPath)
      Creates a NERecogniser by loading model from given path
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> getEntityTypes()
      Gets set of entity types recognised by this recogniser
      boolean isAvailable()
      checks if this Named Entity recogniser is available for service
      java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> recognise​(java.lang.String text)
      recognises names of entities in the text
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ENTITY_TYPES

        public static final java.util.Set<java.lang.String> ENTITY_TYPES
    • Constructor Detail

      • MITIENERecogniser

        public MITIENERecogniser()
      • MITIENERecogniser

        public MITIENERecogniser​(java.lang.String modelPath)
        Creates a NERecogniser by loading model from given path
        Parameters:
        modelPath - path to NER model file
    • 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 model was available, valid and was able to initialise the classifier. returns false when this recogniser is not available for service.
      • getEntityTypes

        public java.util.Set<java.lang.String> getEntityTypes()
        Gets set of entity types recognised by this recogniser
        Specified by:
        getEntityTypes in interface NERecogniser
        Returns:
        set of entity classes/types
      • recognise

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> recognise​(java.lang.String text)
        recognises names of entities in the text
        Specified by:
        recognise in interface NERecogniser
        Parameters:
        text - text which possibly contains names
        Returns:
        map of entity type -> set of names