Skip to content

Instantly share code, notes, and snippets.

@rsepassi
Created February 25, 2019 21:55
Show Gist options
  • Save rsepassi/d6d224a25529e01b52c66c030c28cd12 to your computer and use it in GitHub Desktop.
Save rsepassi/d6d224a25529e01b52c66c030c28cd12 to your computer and use it in GitHub Desktop.
# See the built-in configs
configs = tfds.text.IMDBReviews.builder_configs
assert "bytes" in configs
# Address a built-in config with tfds.builder
imdb = tfds.builder("imdb_reviews/bytes")
# or when constructing the builder directly
imdb = tfds.text.IMDBReviews(config="bytes")
# or use your own custom configuration
my_encoder = tfds.features.text.ByteTextEncoder(additional_tokens=['hello'])
my_config = tfds.text.IMDBReviewsConfig(
name="my_config",
version="1.0.0",
text_encoder_config=tfds.features.text.TextEncoderConfig(encoder=my_encoder),
)
imdb = tfds.text.IMDBReviews(config=my_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment