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

Questions about training data preprocessing #74

Closed
liuqi6777 opened this issue Jan 12, 2023 · 1 comment
Closed

Questions about training data preprocessing #74

liuqi6777 opened this issue Jan 12, 2023 · 1 comment

Comments

@liuqi6777
Copy link

Hi!

I noticed that "attention_mask" was ignored when preprocessing the training data, as shown in the code of the file src/tevatron/data.py.

class TrainDataset(Dataset):
    def create_one_example(self, text_encoding: List[int], is_query=False):
        item = self.tok.prepare_for_model(
            text_encoding,
            truncation='only_first',
            max_length=self.data_args.q_max_len if is_query else self.data_args.p_max_len,
            padding=False,
            return_attention_mask=False,
            return_token_type_ids=False,
        )
        return item

And I found that some other sources of work on dense retrieval didn't do this. So I want to ask what is the reason for designing the code like this.

Thanks for your answer:)

@liuqi6777
Copy link
Author

I just found that the QPCollator will add "attention_mask" to it.

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

No branches or pull requests

1 participant