class_docstr: This factory is used to create masked language modeling (MLM) task heads.
  This is required due to Transformers implementing different MLM heads for
  different encoders.
  
  Attributes:
      registry (dict): Dynamic registry mapping model architectures to MLM task heads
class_docstr_tok: ["This","factory","is","used","to","create","masked","language","modeling","(","MLM",")","task","heads",".","This","is","required","due","to","Transformers","implementing","different","MLM","heads","for","different","encoders",".","Attributes",":","registry","(","dict",")",":","Dynamic","registry","mapping","model","architectures","to","MLM","task","heads"]
docstr: Summary
  
  Args:
      task (Task): Task used to initialize task head
      **kwargs: Additional arguments required to initialize task head
code: def __call__(self, task, **kwargs):
      """Summary
  
      Args:
          task (Task): Task used to initialize task head
          **kwargs: Additional arguments required to initialize task head
      """
      mlm_head_class = self.registry[task.TASK_TYPE]
      mlm_head = mlm_head_class(task, **kwargs)
      return mlm_head
  
imports: from __future__ import annotations
  import abc
  import torch
  import torch.nn
  import transformers
  from jiant.ext.allennlp import SelfAttentiveSpanExtractor
  from jiant.shared.model_resolution import ModelArchitectures
  from jiant.tasks.core import TaskTypes
  from typing import Callable
  from typing import List
label_desc: Use image node_id 2 for calling the JiantMLMHeadFactory obj's underlying member method code with example usage: obj.__call__(task) and returns: mlm_head