public final class PtBertVocabulary
extends java.lang.Object
implements ai.djl.modality.nlp.Vocabulary
| Modifier and Type | Method and Description |
|---|---|
long |
getIndex(java.lang.String token) |
java.lang.String |
getToken(long index) |
static PtBertVocabulary |
parse(java.io.InputStream is)
Parse the vocabulary file and create
PtBertVocabulary. |
static PtBertVocabulary |
parse(java.nio.file.Path path)
Parses the vocabulary file and create
MxBertVocabulary. |
static PtBertVocabulary |
parse(java.lang.String url)
Parses the vocabulary file and create
PtBertVocabulary. |
public static PtBertVocabulary parse(java.nio.file.Path path)
MxBertVocabulary.path - the input file pathPtBertVocabularypublic static PtBertVocabulary parse(java.lang.String url)
PtBertVocabulary.url - the input vocabulary file urlPtBertVocabularypublic static PtBertVocabulary parse(java.io.InputStream is)
PtBertVocabulary.is - the input InputStream of the vocabulary filePtBertVocabularypublic long getIndex(java.lang.String token)
getIndex in interface ai.djl.modality.nlp.Vocabularypublic java.lang.String getToken(long index)
getToken in interface ai.djl.modality.nlp.Vocabulary