code: def BuildLMGraph(self, sent):
      dy.renew_cg()
      init_state = self.builder.initial_state()
  
      errs = []  # will hold expressions
      es = []
      state = init_state
      inputs = [self.lookup[int(cw)] for cw in sent[:-1]]
      expected_outputs = [int(nw) for nw in sent[1:]]
      outputs = state.transduce(inputs)
      r_ts = ((self.bias + (self.R * y_t)) for y_t in outputs)
      errs = [
          dy.pickneglogsoftmax(r_t, eo)
          for r_t, eo in zip(r_ts, expected_outputs)
      ]
      nerr = dy.esum(errs)
      return nerr
  
file_path: dynet/examples/rnnlm/rnnlm_transduce.py
imports: import dynet
  import time
  import random
  import argparse
  import sys
  import util
label_desc: Use image node_id 2 for calling the RNNLanguageModel obj's underlying member method code with example usage: obj.BuildLMGraph(sent) and returns: nerr