allenai / allenai/sequential_sentence_classification

Possibility of bug with batch_size > 1 and long intermediate sentences with bert-base models

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
77
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Hi,

First of all, thanks for publicly sharing your code. I think, there is a bug when batch_size > 1 and when an intermediate instance in this batch gets truncated when its number of sub-tokens exceed 512 (while using a bert-base transformer model).

https://github.com/allenai/sequential_sentence_classification/blob/master/sequential_sentence_classification/model.py#L135

Here, instead of truncating the labels on the intermediate instance, the current code is truncating the labels at the end of the batch. This might result in label-mismatch especially for the following instances in that batch. Can you confirm this and if there is a bug indeed, I would like to volunteer to provide a fix for this.

Thanks,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.