public class CollectionLabeledSentenceProvider extends Object implements LabeledSentenceProvider
| Constructor and Description |
|---|
CollectionLabeledSentenceProvider(List<String> sentences,
List<String> labelsForSentences) |
CollectionLabeledSentenceProvider(List<String> sentences,
List<String> labelsForSentences,
Random rng) |
| 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.linalg.primitives.Pair<String,String> |
nextSentence() |
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 CollectionLabeledSentenceProvider(@NonNull
List<String> sentences,
@NonNull
List<String> labelsForSentences)
public boolean hasNext()
LabeledSentenceProviderhasNext in interface LabeledSentenceProviderpublic org.nd4j.linalg.primitives.Pair<String,String> nextSentence()
nextSentence in interface LabeledSentenceProviderpublic void reset()
LabeledSentenceProviderreset in interface LabeledSentenceProviderpublic int totalNumSentences()
LabeledSentenceProvidertotalNumSentences in interface LabeledSentenceProviderpublic List<String> allLabels()
LabeledSentenceProviderallLabels in interface LabeledSentenceProviderpublic int numLabelClasses()
LabeledSentenceProvidernumLabelClasses in interface LabeledSentenceProviderCopyright © 2018. All rights reserved.