public class CollectionLabeledPairSentenceProvider extends Object implements LabeledPairSentenceProvider
| Constructor and Description |
|---|
CollectionLabeledPairSentenceProvider(@NonNull List<String> sentenceL,
@NonNull List<String> sentenceR,
@NonNull List<String> labelsForSentences)
Lists containing sentences to iterate over with a third for labels
Sentences in the same position in the first two lists are considered a pair
|
CollectionLabeledPairSentenceProvider(@NonNull List<String> sentenceL,
List<String> sentenceR,
@NonNull List<String> labelsForSentences,
Random rng)
Lists containing sentences to iterate over with a third for labels
Sentences in the same position in the first two lists are considered a pair
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
allLabels()
Return the list of labels - this also defines the class/integer label assignment order
|
boolean |
hasNext()
Are there more sentences/documents available?
|
org.nd4j.common.primitives.Triple<String,String,String> |
nextSentencePair() |
int |
numLabelClasses()
Equivalent to allLabels().size()
|
void |
reset()
Reset the iterator - including shuffling the order, if necessary/appropriate
|
int |
totalNumSentences()
Return the total number of sentences, or -1 if not available
|
public CollectionLabeledPairSentenceProvider(@NonNull
@NonNull List<String> sentenceL,
@NonNull
@NonNull List<String> sentenceR,
@NonNull
@NonNull List<String> labelsForSentences)
sentenceL - sentenceR - labelsForSentences - public CollectionLabeledPairSentenceProvider(@NonNull
@NonNull List<String> sentenceL,
List<String> sentenceR,
@NonNull
@NonNull List<String> labelsForSentences,
Random rng)
sentenceL - sentenceR - labelsForSentences - rng - If null, list order is not shuffledpublic boolean hasNext()
LabeledPairSentenceProviderhasNext in interface LabeledPairSentenceProviderpublic org.nd4j.common.primitives.Triple<String,String,String> nextSentencePair()
nextSentencePair in interface LabeledPairSentenceProviderpublic void reset()
LabeledPairSentenceProviderreset in interface LabeledPairSentenceProviderpublic int totalNumSentences()
LabeledPairSentenceProvidertotalNumSentences in interface LabeledPairSentenceProviderpublic List<String> allLabels()
LabeledPairSentenceProviderallLabels in interface LabeledPairSentenceProviderpublic int numLabelClasses()
LabeledPairSentenceProvidernumLabelClasses in interface LabeledPairSentenceProviderCopyright © 2021. All rights reserved.