code: protected Dataset<Sequence> getDataset(SequenceFeaturizer<Character> featurizer) {
        List<Sequence> trainingData = new ArrayList<>();
        try (MStream<String> lines = corpus.lines()) {
           lines.forEach(line -> {
              line = line.trim();
              if (StringUtils.isNotNullOrBlank(line)) {
                 SequenceInput<Character> input = new SequenceInput<>();
                 for (int i = 0; i < line.length(); i++) {
                    char c = line.charAt(i);
                    if (Character.isWhitespace(c)) {
                       input.setLabel(input.size() - 1, "true");
                    } else {
                       input.add(c, "false");
                    }
                 }
                 trainingData.add(featurizer.extractSequence(input.iterator()));
              }
           });
        } catch (Exception e) {
           throw Throwables.propagate(e);
        }
  
        return Dataset.sequence()
                      .type(DatasetType.OffHeap)
                      .source(trainingData.stream());
  
     }
docs: Gets dataset.
  
  @param featurizer the featurizer
  @return the dataset