code: protected Dataset<Sequence> loadDataset() throws Exception {
        return Dataset.sequence()
                      .type(DatasetType.InMemory)
                      .source(
                         Corpus.builder()
                               .source(corpus)
                               .format(corpusFormat)
                               .build()
                               .stream()
                               .filter(d -> d.getAnnotationSet().isCompleted(Types.PART_OF_SPEECH))
                               .flatMap(d -> d.sentences().stream())
                               .map(sentence -> {
                                  SequenceInput<Annotation> input = new SequenceInput<>();
                                  for (int i = 0; i < sentence.tokenLength(); i++) {
                                     POS pos = sentence.tokenAt(i).getPOS();
                                     if (pos == null) {
                                        return null;
                                     }
                                     input.add(sentence.tokenAt(i), pos.asString());
                                  }
                                  return featurizer.get().extractSequence(input.iterator());
                               })
                               .filter(Objects::nonNull)
                             );
     }
docs: Load dataset dataset.
  
  @return the dataset
  @throws Exception the exception