class_docstr: Base class to be inherited by all decoding strategies. Contains
  implementations that are common for all strategies.
  
  Args:
      vocab (list): Collection of all words in vocabulary.
class_docstr_tok: ["Base","class","to","be","inherited","by","all","decoding","strategies",".","Contains","implementations","that","are","common","for","all","strategies",".","Args",":","vocab","(","list",")",":","Collection","of","all","words","in","vocabulary","."]
code: def add_next_word(self, seqs, prev_word_inds, next_word_inds):
      return torch.cat(
          [seqs[prev_word_inds], next_word_inds.unsqueeze(1)], dim=1
      )
  
imports: import os
  import re
  from collections import Counter
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
label_desc: Use image node_id 3 for calling the TextDecoder obj's underlying member method code with example usage: obj.add_next_word(seqs, prev_word_inds, next_word_inds) and returns: torch