Package ai.djl.modality.nlp.translator
Class NamedEntity
- java.lang.Object
-
- ai.djl.modality.nlp.translator.NamedEntity
-
public class NamedEntity extends java.lang.ObjectA class that represents aNamedEntityobject.
-
-
Constructor Summary
Constructors Constructor Description NamedEntity(java.lang.String entity, float score, int index, java.lang.String word, int start, int end)Constructs a new instance ofNamedEntity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEnd()Returns the end index of the word in the sentence.java.lang.StringgetEntity()Returns the class of the entity.intgetIndex()Returns the position of the entity in the original sentence.floatgetScore()Returns the score of the entity.intgetStart()Returns the start index of the word in the sentence.java.lang.StringgetWord()Returns the token of the entity.java.lang.StringtoString()
-
-
-
Constructor Detail
-
NamedEntity
public NamedEntity(java.lang.String entity, float score, int index, java.lang.String word, int start, int end)Constructs a new instance ofNamedEntity.- Parameters:
entity- the class of the entityscore- the score of the entityindex- the position of the entity in the original sentenceword- the token of the entitystart- the start index of the word in the sentenceend- the end index of the word in the sentence
-
-
Method Detail
-
getEntity
public java.lang.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 java.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-