Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Fix TextField padding when there are no tokens #2843

Merged

Conversation

bryant1410
Copy link
Contributor

Related to (fixes?) #1591

The bug is about some TextField in some instance of the dataset that has no tokens and, at the same time, a TokenCharactersIndexer is used. When to_tensor is called it fails.

@bryant1410 bryant1410 changed the title Add test for getting the tensor of empty text field with token indexer Fix TextField padding when there are no tokens May 15, 2019
@schmmd schmmd requested a review from matt-gardner May 30, 2019 16:26
@schmmd
Copy link
Member

schmmd commented May 30, 2019

Thanks! Seems like a good improvement but I requested a review from someone whose a bit deeper in the codebase.

Copy link
Contributor

@matt-gardner matt-gardner left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for doing this!

@matt-gardner matt-gardner merged commit 6afba9a into allenai:master May 30, 2019
@bryant1410 bryant1410 deleted the text-field-token-indexer-empty-token branch May 30, 2019 22:07
reiyw pushed a commit to reiyw/allennlp that referenced this pull request Nov 12, 2019
* Add test for getting the tensor of empty text field with token indexer

* Fix TextField padding when there are no tokens
TalSchuster pushed a commit to TalSchuster/allennlp-MultiLang that referenced this pull request Feb 20, 2020
* Add test for getting the tensor of empty text field with token indexer

* Fix TextField padding when there are no tokens
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants