# Using LongformerForMultipleChoice for processing multiple-choice questions with the 4 options

**URL:** <https://discuss.huggingface.co/t/using-longformerformultiplechoice-for-processing-multiple-choice-questions-with-the-4-options/1475>\
**Category:** 🤗Transformers\
**Created:** [October 11, 2020, 4:54pm UTC](https://discuss.huggingface.co/t/using-longformerformultiplechoice-for-processing-multiple-choice-questions-with-the-4-options/1475 "2020-10-11T16:54:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![h56cho](https://avatars.discourse-cdn.com/v4/letter/h/c2a13f/32.png) [@h56cho](https://discuss.huggingface.co/u/h56cho)\
**Post date:** [October 11, 2020, 4:54pm UTC](https://discuss.huggingface.co/t/using-longformerformultiplechoice-for-processing-multiple-choice-questions-with-the-4-options/1475/1 "2020-10-11T16:54:38Z")

</div>

Hello,

Suppose that I want to process multiple-choice questions with 4 options with `LongformerForMultipleChoice`.

so each question has `main_question`, `option1`, `option2`, `option3`, and `option4`.

How can I generate `input_ids` from the `LongformerTokenizer`, so that the `LongformerForMultipleChoice` can correctly take each of my multiple-choice question as the ones with 4 options?

Thank you,

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [October 13, 2020, 7:22am UTC](https://discuss.huggingface.co/t/using-longformerformultiplechoice-for-processing-multiple-choice-questions-with-the-4-options/1475/2 "2020-10-13T07:22:47Z")

</div>

What you are doing here seems correct

> [@Strange error when using the Longformer (HuggingFace developers, please reply)](https://discuss.huggingface.co/t/strange-error-when-using-the-longformer-huggingface-developers-please-reply/1468):
>
> Hello, I am trying to use LongformerForMultipleChoice model, and the code I am using is the following: # import the pre-trained HuggingFace Longformer tokenizer. longformer\_tokenizer = LongformerTokenizer.from\_pretrained('allenai/longformer-base-4096') # get the pre-trained HuggingFace Longformer best\_model\_longformer = LongformerForMultipleChoice.from\_pretrained('allenai/longformer-base-4096', output\_hidden\_states = True) # my multipl…

just make sure when you are passing `labels` it’s value should be between `[0.. num_choices-1]`
