Class NamedEntity

java.lang.Object
ai.djl.modality.nlp.translator.NamedEntity

public class NamedEntity extends Object
A class that represents a NamedEntity object.
  • Constructor Details

    • NamedEntity

      public NamedEntity(String entity, float score, int index, String word, int start, int end)
      Constructs a new instance of NamedEntity.
      Parameters:
      entity - the class of the entity
      score - the score of the entity
      index - the position of the entity in the original sentence
      word - the token of the entity
      start - the start index of the word in the sentence
      end - the end index of the word in the sentence
  • Method Details

    • getEntity

      public String getEntity()
      Returns the class of the entity.
      Returns:
      the class of the entity
    • getScore

      public float getScore()
      Returns the score of the entity.
      Returns:
      the score of the entity
    • getIndex

      public int getIndex()
      Returns the position of the entity in the original sentence.
      Returns:
      the position of the entity in the original sentence
    • getWord

      public String getWord()
      Returns the token of the entity.
      Returns:
      the token of the entity
    • getStart

      public int getStart()
      Returns the start index of the word in the sentence.
      Returns:
      the start index of the word in the sentence
    • getEnd

      public int getEnd()
      Returns the end index of the word in the sentence.
      Returns:
      the end index of the word in the sentence
    • toString

      public String toString()
      Overrides:
      toString in class Object