Package ai.djl.modality.nlp.translator
Class NamedEntity
java.lang.Object
ai.djl.modality.nlp.translator.NamedEntity
A class that represents a
NamedEntity
object.-
Constructor Summary
ConstructorsConstructorDescriptionNamedEntity
(String entity, float score, int index, String word, int start, int end) Constructs a new instance ofNamedEntity
. -
Method Summary
Modifier and TypeMethodDescriptionint
getEnd()
Returns the end index of the word in the sentence.Returns the class of the entity.int
getIndex()
Returns the position of the entity in the original sentence.float
getScore()
Returns the score of the entity.int
getStart()
Returns the start index of the word in the sentence.getWord()
Returns the token of the entity.toString()
-
Constructor Details
-
NamedEntity
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 Details
-
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
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
-