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 update_data(
      self, data, prev_word_inds, next_word_inds, incomplete_inds
  ):
      data["texts"] = next_word_inds[incomplete_inds].unsqueeze(1)
      h1 = data["state"]["td_hidden"][0][
          prev_word_inds[incomplete_inds]
      ]
      c1 = data["state"]["td_hidden"][1][
          prev_word_inds[incomplete_inds]
      ]
      h2 = data["state"]["lm_hidden"][0][
          prev_word_inds[incomplete_inds]
      ]
      c2 = data["state"]["lm_hidden"][1][
          prev_word_inds[incomplete_inds]
      ]
      data["state"] = {"td_hidden": (h1, c1), "lm_hidden": (h2, c2)}
      return data
  
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 5 for calling the TextDecoder obj's underlying member method code with example usage: obj.update_data(data, prev_word_inds, next_word_inds, incomplete_inds) and returns: data