class_docstr: Scorer class takes a ScoringModel and uses it to score a stream of parallel sentences.
  It also takes the vocabularies so that the original sentences can be printed out, if desired.
  
  :param model: The model to score with.
  :param batch_scorer: BatchScorer block to score each batch.
  :param source_vocabs: The source vocabularies.
  :param target_vocabs: The target vocabularies.
  :param device: Torch device to load batches to (should be set to model device).
class_docstr_tok: ["Scorer","class","takes","a","ScoringModel","and","uses","it","to","score","a","stream","of","parallel","sentences",".","It","also","takes","the","vocabularies","so","that","the","original","sentences","can","be","printed","out",",","if","desired",".",":","param","model",":","The","model","to","score","with",".",":","param","batch_scorer",":","BatchScorer","block","to","score","each","batch",".",":","param","source_vocabs",":","The","source","vocabularies",".",":","param","target_vocabs",":","The","target","vocabularies",".",":","param","device",":","Torch","device","to","load","batches","to","(","should","be","set","to","model","device",")","."]
code: def __init__(
      self,
      model: SockeyeModel,
      batch_scorer: BatchScorer,
      source_vocabs: List[vocab.Vocab],
      target_vocabs: List[vocab.Vocab],
      device: pt.device,
  ) -> None:
      self.source_vocab_inv = vocab.reverse_vocab(source_vocabs[0])
      self.target_vocab_inv = vocab.reverse_vocab(target_vocabs[0])
      self.model = model
      self.traced_model = None  # type: Optional[pt.jit.ScriptModule]
      self.batch_scorer = batch_scorer
      self.traced_batch_scorer = (
          None
      )  # type: Optional[pt.jit.ScriptModule]
      self.device = device
      self.exclude_list = {C.BOS_ID, C.EOS_ID, C.PAD_ID}
      self.num_target_factors = self.model.num_target_factors
  
imports: import logging
  import math
  import time
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from .None import constants
  from .None import data_io
  from .None import inference
  from .None import vocab
  from .beam_search import CandidateScorer
  from .model import SockeyeModel
  from .output_handler import OutputHandler
label_desc: Use image node_id 1 to create a new Scorer object  with example: obj = Scorer(model, batch_scorer, source_vocabs, target_vocabs, device)