code: def get_new_ngram(ngram, n, vocab):
      """
      replace ngram `ngram` with a newly sampled ngram of the same length
      """
  
      new_ngram_wids = [
          np.random.randint(3, len(vocab)) for i in range(n)
      ]
      new_ngram = [vocab.id2word[wid] for wid in new_ngram_wids]
  
      return new_ngram
  
file_path: texar/examples/seq2seq_exposure_bias/utils/raml_samples_generation/process_samples.py
imports: from nltk.translate.bleu_score import sentence_bleu
  from nltk.translate.bleu_score import SmoothingFunction
  import sys
  import re
  import argparse
  import torch
  from util import read_corpus
  import numpy
  from scipy.misc import comb
  from vocab import Vocab, VocabEntry
  import math
  from rouge import Rouge
label_desc: Use image node_id 3 for calling a global function with example usage: get_new_ngram(ngram, n, vocab) and returns: new_ngram