How can I use tokenizer.encode_plus to input and encode 2 sentences - (query,answer) pair for training a BERT binary classifier?
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. Make sure to tag your question with the
     right deep learning framework as well as the huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->

## Details
<!-- Description of your issue -->

<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on Stack Overflow**:

Here my intention is to train a BERT binary classifier which classifies if an answer corresponding to a given query is correct. How do I proceed to encode the query, answer pair in the Input?<|||||>@soumya-ranjan-sahoo You could check the [token type ids](https://huggingface.co/transformers/glossary.html#token-type-ids). Please feed the question and answer to the, for instance, encode_plus function and generate type type ids. 

Then you could just feed the token type ids with, for instance, input ids and attention masks to conduct classification<|||||>@bright1993ff66 Great. I was successful in my experiment. But now I have a follow-up question. I understand the maximum length of the permissible words for BERT is 512. In my case (sentence pair classification) does that imply the combined word length for the query and the answer has to be 512 since I have huge answers for my experiment. 
Surprisingly I was able to fine-tune BERT with query and answer (most query-answer pair have a combined word length of more than 512), and BERT didn't throw any error or warnings. How did it fine-tune or what it exactly did with such sentences? 

Thank you. 

<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
