public class BertIterator extends Object implements org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
| Modifier and Type | Class and Description |
|---|---|
static class |
BertIterator.Builder |
static class |
BertIterator.FeatureArrays |
static class |
BertIterator.LengthHandling |
static class |
BertIterator.Task |
static class |
BertIterator.UnsupervisedLabelFormat |
| Modifier and Type | Field and Description |
|---|---|
protected String |
appendToken |
protected BertIterator.FeatureArrays |
featureArrays |
protected BertIterator.LengthHandling |
lengthHandling |
protected BertSequenceMasker |
masker |
protected String |
maskToken |
protected int |
maxTokens |
protected int |
minibatchSize |
protected boolean |
padMinibatches |
protected String |
prependToken |
protected org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor |
preProcessor |
protected LabeledPairSentenceProvider |
sentencePairProvider |
protected LabeledSentenceProvider |
sentenceProvider |
protected BertIterator.Task |
task |
protected TokenizerFactory |
tokenizerFactory |
protected BertIterator.UnsupervisedLabelFormat |
unsupervisedLabelFormat |
protected List<String> |
vocabKeysAsList |
protected Map<String,Integer> |
vocabMap |
| Modifier | Constructor and Description |
|---|---|
protected |
BertIterator(BertIterator.Builder b) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asyncSupported() |
static BertIterator.Builder |
builder() |
org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]> |
featurizeSentencePairs(List<org.nd4j.common.primitives.Pair<String,String>> listOnlySentencePairs)
For use during inference.
|
org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]> |
featurizeSentences(List<String> listOnlySentences)
For use during inference.
|
boolean |
hasNext() |
org.nd4j.linalg.dataset.api.MultiDataSet |
next() |
org.nd4j.linalg.dataset.api.MultiDataSet |
next(int num) |
void |
remove() |
void |
reset() |
boolean |
resetSupported() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPreProcessor, setPreProcessorforEachRemainingprotected BertIterator.Task task
protected TokenizerFactory tokenizerFactory
protected int maxTokens
protected int minibatchSize
protected boolean padMinibatches
protected org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor preProcessor
protected LabeledSentenceProvider sentenceProvider
protected LabeledPairSentenceProvider sentencePairProvider
protected BertIterator.LengthHandling lengthHandling
protected BertIterator.FeatureArrays featureArrays
protected BertSequenceMasker masker
protected BertIterator.UnsupervisedLabelFormat unsupervisedLabelFormat
protected String maskToken
protected String prependToken
protected String appendToken
protected BertIterator(BertIterator.Builder b)
public boolean hasNext()
hasNext in interface Iterator<org.nd4j.linalg.dataset.api.MultiDataSet>public org.nd4j.linalg.dataset.api.MultiDataSet next()
next in interface Iterator<org.nd4j.linalg.dataset.api.MultiDataSet>public void remove()
remove in interface Iterator<org.nd4j.linalg.dataset.api.MultiDataSet>public org.nd4j.linalg.dataset.api.MultiDataSet next(int num)
next in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIteratorpublic org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]> featurizeSentences(List<String> listOnlySentences)
listOnlySentences - public org.nd4j.common.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray[],org.nd4j.linalg.api.ndarray.INDArray[]> featurizeSentencePairs(List<org.nd4j.common.primitives.Pair<String,String>> listOnlySentencePairs)
listOnlySentencePairs - public boolean resetSupported()
resetSupported in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIteratorpublic boolean asyncSupported()
asyncSupported in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIteratorpublic void reset()
reset in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIteratorpublic static BertIterator.Builder builder()
Copyright © 2021. All rights reserved.