Package ai.djl.basicdataset.nlp
Class TextDataset.Sample
java.lang.Object
ai.djl.basicdataset.nlp.TextDataset.Sample
- Enclosing class:
- TextDataset
A class stores
TextDataset sample information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetIndex()Returns the sample index.intReturns the sentence length.
-
Constructor Details
-
Sample
public Sample(int index, int sentenceLength) Constructs a newSampleinstance.- Parameters:
index- the indexsentenceLength- the sentence length
-
-
Method Details
-
getSentenceLength
public int getSentenceLength()Returns the sentence length.- Returns:
- the sentence length
-
getIndex
public long getIndex()Returns the sample index.- Returns:
- the sample index
-