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

Improvements to sentence data structure #538

Merged
merged 2 commits into from Nov 14, 2018
Merged

Improvements to sentence data structure #538

merged 2 commits into from Nov 14, 2018

Conversation

msperber
Copy link
Contributor

This PR contains two improvements for the sentence data structure which I found useful for some downstream tasks:

  • __getitem__ is now part of the base class interface
  • Padded sentences are now able to return their unpadded versions, either by storing a reference to the original unpadded sentence or by using __getitem__ and the already existing len_unpadded() method. This is useful to get the original sentences in places in the code where minibatches of (padded) sentences are passed.

@neubig neubig merged commit 25a3ed3 into master Nov 14, 2018
@msperber msperber deleted the sent-unpadded branch November 15, 2018 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants