def load_inverse_dict(dict_path): orig_dict = load_dict(dict_path) idict = {} for words, idx in orig_dict.iteritems(): idict[idx] = words return idict