class_docstr: Register as an `DataCollator` with name `LanguageModelingDataCollator`
  Used for language modeling.
class_docstr_tok: ["Register","as","an","`","DataCollator","`","with","name","`","LanguageModelingDataCollator","`","Used","for","language","modeling","."]
code: def __call__(self, instances: List[Instance]) -> TensorDict:
      tensor_dicts = allennlp_collate(instances)
      tensor_dicts = self.process_tokens(tensor_dicts)
      return tensor_dicts
  
file_path: allennlp/allennlp/data/data_loaders/data_collator.py
imports: from typing import List
  from transformers.data.data_collator import DataCollatorForLanguageModeling
  from allennlp.common import Registrable
  from allennlp.data.batch import Batch
  from allennlp.data.data_loaders.data_loader import TensorDict
  from allennlp.data.instance import Instance
label_desc: Use image node_id 2 for calling the LanguageModelingDataCollator obj's underlying member method code with example usage: obj.__call__(instances) and returns: tensor_dicts