docstr: Creates MLM scorer from https://arxiv.org/abs/1910.14659.
  Args:
      model_name: HuggingFace pretrained model name
      device: either 'cpu' or 'cuda'
docstr_tok: ["Creates","MLM","scorer","from","https",":","\/\/arxiv.org\/abs\/1910.14659",".","Args",":","model_name",":","HuggingFace","pretrained","model","name","device",":","either","'cpu","'","or","'cuda","'"]
code: def __init__(self, model_name: str, device: str = "cpu"):
      """
      Creates MLM scorer from https://arxiv.org/abs/1910.14659.
      Args:
          model_name: HuggingFace pretrained model name
          device: either 'cpu' or 'cuda'
      """
      self.model = (
          AutoModelForMaskedLM.from_pretrained(model_name)
          .to(device)
          .eval()
      )
      self.tokenizer = AutoTokenizer.from_pretrained(
          model_name, use_fast=False
      )
      self.device = device
      self.MASK_LABEL = self.tokenizer.mask_token
  
file_path: NeMo/nemo/collections/common/parts/mlm_scorer.py
imports: from typing import List
  import numpy
  import torch
  from torch.nn.functional import softmax
  from transformers import AutoModelForMaskedLM, AutoTokenizer
label_desc: Use image node_id 1 to create a new MLMScorer object  with example: obj = MLMScorer(model_name, device)