def _encode_dataset(self,
                      dataset,
                      filter_claims=True,
                      filter_evidence=True):
    """Convert the tfds dataset to numbers by tokenizing/embedding."""
    if self._encoder is None:
      raise ValueError('Cannot encode dataset without an encoder.')
    encode = self._encoder.build_encoder_fn()
    encoded_data = dataset.map(
        encode, num_parallel_calls=tf.data.experimental.AUTOTUNE)
    if filter_claims:
      encoded_data = encoded_data.filter(preprocessing.filter_claim_fn)
    if filter_evidence:
      encoded_data = encoded_data.filter(preprocessing.filter_evidence_fn)

    return encoded_data
Convert the tfds dataset to numbers by tokenizing/embedding.
language/serene/training.py