Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change features vs schema logic #423

Merged
merged 5 commits into from
Jul 23, 2020
Merged

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Jul 21, 2020

New logic for nlp.Features in datasets

Previously, it was confusing to have features and pyarrow's schema in nlp.Dataset.
However features is supposed to be the front-facing object to define the different fields of a dataset, while schema is only used to write arrow files.

Changes:

  • Remove schema field in nlp.Dataset
  • Make features the source of truth to read/write examples
  • features can no longer be None in nlp.Dataset
  • Update features after each dataset transform such as nlp.Dataset.map

Todo: change the tests to take these changes into account

@lhoestq
Copy link
Member Author

lhoestq commented Jul 22, 2020

I had to make SplitDict serializable to be able to copy DatasetInfo objects properly.
Serialization was also asked in #389

@lhoestq lhoestq marked this pull request as ready for review July 22, 2020 17:15
@lhoestq lhoestq force-pushed the change-features-vs-schema-logic branch from f754505 to d1f3821 Compare July 22, 2020 17:33
Copy link
Member

@thomwolf thomwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool!

@thomwolf
Copy link
Member

One thing I forgot to say here, is that we also want to use the features arguments of load_dataset (which goes in the builder’s config) to override the default features of a dataset script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants