public class BertToken
extends java.lang.Object
Constructor and Description |
---|
BertToken(java.util.List<java.lang.String> tokens,
java.util.List<java.lang.Long> tokenType,
java.util.List<java.lang.Long> attentionMask,
int validLength)
Creates an instance of BertToken which includes information for Bert model.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Long> |
getAttentionMask()
Gets the mask to avoid performing attention on padding token indices.
|
java.util.List<java.lang.String> |
getTokens()
Gets the indices of input sequence tokens in the vocabulary.
|
java.util.List<java.lang.Long> |
getTokenTypes()
Gets segment token indices to indicate first and second portions of the inputs.
|
int |
getValidLength()
Gets the length of the original sentence which has question and paragraph.
|
public BertToken(java.util.List<java.lang.String> tokens, java.util.List<java.lang.Long> tokenType, java.util.List<java.lang.Long> attentionMask, int validLength)
tokens
- indices of input sequence tokens in the vocabulary.tokenType
- segment token indices to indicate first and second portions of the inputs.attentionMask
- mask to avoid performing attention on padding token indices.validLength
- length that indicates the original input sequence.public java.util.List<java.lang.String> getTokens()
public java.util.List<java.lang.Long> getTokenTypes()
public java.util.List<java.lang.Long> getAttentionMask()
public int getValidLength()