Java Code Examples for org.datavec.api.writable.Text#toString()
The following examples show how to use
org.datavec.api.writable.Text#toString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RegexLineRecordReader.java From DataVec with Apache License 2.0 | 5 votes |
@Override public List<Writable> next() { if (numLinesSkipped < skipNumLines) { for (int i = numLinesSkipped; i < skipNumLines; i++, numLinesSkipped++) { if (!hasNext()) { return new ArrayList<>(); } super.next(); } } Text t = (Text) super.next().iterator().next(); String val = t.toString(); return parseLine(val); }
Example 2
Source File: CSVRecordReader.java From DataVec with Apache License 2.0 | 5 votes |
@Override public List<Writable> next() { if (!skipLines()) throw new NoSuchElementException("No next element found!"); Text t = (Text) super.next().iterator().next(); String val = t.toString(); return parseLine(val); }
Example 3
Source File: RegexLineRecordReader.java From deeplearning4j with Apache License 2.0 | 5 votes |
@Override public List<Writable> next() { if (numLinesSkipped < skipNumLines) { for (int i = numLinesSkipped; i < skipNumLines; i++, numLinesSkipped++) { if (!hasNext()) { return new ArrayList<>(); } super.next(); } } Text t = (Text) super.next().iterator().next(); String val = t.toString(); return parseLine(val); }
Example 4
Source File: WordPieceTokenizerStepRunner.java From konduit-serving with Apache License 2.0 | 4 votes |
@Override public Record[] transform(Record[] input) { Preconditions.checkNotNull(input, "Input records were null!"); List<Record> recordList = new ArrayList<>(); for(Record record : input) { Text text = (Text) record.getRecord().get(0); String sentence = text.toString(); List<Writable> textWritable = new ArrayList<>(); MultiDataSet mds = this.getToken(sentence).next(); textWritable.add(WritableValueRetriever.writableFromValue(mds.getFeatures(0))); recordList.add(new org.datavec.api.records.impl.Record(textWritable, null)); } return recordList.toArray(new Record[recordList.size()]); }
Example 5
Source File: JacksonLineRecordReader.java From DataVec with Apache License 2.0 | 4 votes |
@Override public List<Writable> next() { Text t = (Text) super.next().iterator().next(); String val = t.toString(); return parseLine(val); }
Example 6
Source File: JacksonLineRecordReader.java From deeplearning4j with Apache License 2.0 | 4 votes |
@Override public List<Writable> next() { Text t = (Text) super.next().iterator().next(); String val = t.toString(); return parseLine(val); }
Example 7
Source File: CSVRecordReader.java From deeplearning4j with Apache License 2.0 | 4 votes |
protected String readStringLine(){ Preconditions.checkState(initialized, "RecordReader has not been initialized before use"); Text t = (Text) super.next().iterator().next(); return t.toString(); }