[Question] BERT-style multiple choice formatting
{'login': 'sarahwie', 'id': 8027676, 'node_id': 'MDQ6VXNlcjgwMjc2NzY=', 'avatar_url': 'https://avatars.githubusercontent.com/u/8027676?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/sarahwie', 'html_url': 'https://github.com/sarahwie', 'followers_url': 'https://api.github.com/users/sarahwie/followers', 'following_url': 'https://api.github.com/users/sarahwie/following{/other_user}', 'gists_url': 'https://api.github.com/users/sarahwie/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/sarahwie/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/sarahwie/subscriptions', 'organizations_url': 'https://api.github.com/users/sarahwie/orgs', 'repos_url': 'https://api.github.com/users/sarahwie/repos', 'events_url': 'https://api.github.com/users/sarahwie/events{/privacy}', 'received_events_url': 'https://api.github.com/users/sarahwie/received_events', 'type': 'User', 'site_admin': False}
[]
[]
['Hi @sarahwie, can you details this a little more?\r\n\r\nI\'m not sure I understand what you refer to and what you mean when you say "Previously, this was done by passing a list of InputFeatures to the dataloader instead of a list of InputFeature"'
 'I think I\'ve resolved it. For others\' reference: to convert from using the [`MultipleChoiceDataset` class](https://github.com/huggingface/transformers/blob/a34a9896ac2a4a33ff9cd805c76eed914c8d8965/examples/multiple-choice/utils_multiple_choice.py#L82)/[`run_multiple_choice.py`](https://github.com/huggingface/transformers/blob/a34a9896ac2a4a33ff9cd805c76eed914c8d8965/examples/multiple-choice/run_multiple_choice.py) script in Huggingface Transformers, I\'ve done the following for hellaswag:\r\n\r\n1. converted the `convert_examples_to_features()` function to only take one input and return a dictionary rather than a list:\r\n```\r\ndef convert_examples_to_features(example, tokenizer, max_length):\r\n\r\n    choices_inputs = defaultdict(list)\r\n    for ending_idx, ending in enumerate(example[\'endings\'][\'ending\']):\r\n        text_a = example[\'ctx\']\r\n        text_b = ending\r\n\r\n        inputs = tokenizer.encode_plus(\r\n            text_a,\r\n            text_b,\r\n            add_special_tokens=True,\r\n            max_length=max_length,\r\n            pad_to_max_length=True,\r\n            return_overflowing_tokens=True,\r\n        )\r\n        if "num_truncated_tokens" in inputs and inputs["num_truncated_tokens"] > 0:\r\n            logger.info(\r\n                "Attention! you are cropping tokens (swag task is ok). "\r\n                "If you are training ARC and RACE and you are poping question + options,"\r\n                "you need to try to use a bigger max seq length!"\r\n            )\r\n\r\n        for key in inputs:\r\n            choices_inputs[key].append(inputs[key])\r\n            \r\n        choices_inputs[\'label\'] = int(example[\'label\'])\r\n\r\n    return choices_inputs\r\n```\r\n2. apply this directly (instance-wise) to dataset, convert dataset to torch tensors. Dataset is then ready to be passed to `Trainer` instance.\r\n\r\n```\r\ndataset[\'train\'] = dataset[\'train\'].map(lambda x: convert_examples_to_features(x, tokenizer, max_length), batched=False)\r\ncolumns = [\'input_ids\', \'token_type_ids\', \'attention_mask\', \'label\']\r\ndataset[\'train\'].set_format(type=\'torch\', columns=columns)\r\n```']
Hello, I am wondering what the equivalent formatting of a dataset should be to allow for multiple-choice answering prediction, BERT-style. Previously, this was done by passing a list of `InputFeatures` to the dataloader instead of a list of `InputFeature`, where `InputFeatures` contained lists of length equal to the number of answer choices in the MCQ instead of single items. I'm a bit confused on what the output of my feature conversion function should be when using `dataset.map()` to ensure similar behavior.

Thanks!
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/189/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}