class_docstr: Create Vocabulary class from a given vocabulary and its id-word, word-id convert.
  See create_vocab() and ``tutorial_tfrecord3.py``.
  
  Parameters
  -----------
  vocab_file : str
      The file contains the vocabulary (can be created via ``tl.nlp.create_vocab``), where the words are the first whitespace-separated token on each line (other tokens are ignored) and the word ids are the corresponding line numbers.
  start_word : str
      Special word denoting sentence start.
  end_word : str
      Special word denoting sentence end.
  unk_word : str
      Special word denoting unknown words.
  
  Attributes
  ------------
  vocab : dictionary
      A dictionary that maps word to ID.
  reverse_vocab : list of int
      A list that maps ID to word.
  start_id : int
      For start ID.
  end_id : int
      For end ID.
  unk_id : int
      For unknown ID.
  pad_id : int
      For Padding ID.
  
  Examples
  -------------
  The vocab file looks like follow, includes `start_word` , `end_word` ...
  
  >>> a 969108
  >>> <S> 586368
  >>> </S> 586368
  >>> . 440479
  >>> on 213612
  >>> of 202290
  >>> the 196219
  >>> in 182598
  >>> with 152984
  >>> and 139109
  >>> is 97322
class_docstr_tok: ["Create","Vocabulary","class","from","a","given","vocabulary","and","its","id-word",",","word-id","convert",".","See","create_vocab","(",")","and","``","tutorial_tfrecord3.py","``",".","Parameters","--","--","--","--","--","-","vocab_file",":","str","The","file","contains","the","vocabulary","(","can","be","created","via","``","tl.nlp.create_vocab","``",")",",","where","the","words","are","the","first","whitespace-separated","token","on","each","line","(","other","tokens","are","ignored",")","and","the","word","ids","are","the","corresponding","line","numbers",".","start_word",":","str","Special","word","denoting","sentence","start",".","end_word",":","str","Special","word","denoting","sentence","end",".","unk_word",":","str","Special","word","denoting","unknown","words",".","Attributes","--","--","--","--","--","--","vocab",":","dictionary","A","dictionary","that","maps","word","to","ID",".","reverse_vocab",":","list","of","int","A","list","that","maps","ID","to","word",".","start_id",":","int","For","start","ID",".","end_id",":","int","For","end","ID",".","unk_id",":","int","For","unknown","ID",".","pad_id",":","int","For","Padding","ID",".","Examples","--","--","--","--","--","--","-","The","vocab","file","looks","like","follow",",","includes","`","start_word","`",",","`","end_word","`","...",">",">",">","a","969108",">",">",">","<","S",">","586368",">",">",">","<","\/S",">","586368",">",">",">",".","440479",">",">",">","on","213612",">",">",">","of","202290",">",">",">","the","196219",">",">",">","in","182598",">",">",">","with","152984",">",">",">","and","139109",">",">",">","is","97322"]
docstr: Returns the word string of an integer word id.
docstr_tok: ["Returns","the","word","string","of","an","integer","word","id","."]
code: def id_to_word(self, word_id):
      """Returns the word string of an integer word id."""
      if word_id >= len(self.reverse_vocab):
          return self.reverse_vocab[self.unk_id]
      else:
          return self.reverse_vocab[word_id]
  
imports: import collections
  import os
  import random
  import re
  import subprocess
  import tempfile
  import warnings
  from collections import Counter
  import numpy
  import six
  import tensorflow
  from six.moves import urllib, xrange
  from tensorflow.python.platform import gfile
  import tensorlayer
  from tensorlayer.lazy_imports import LazyImport
label_desc: Use image node_id 3 for calling the Vocabulary obj's underlying member method code with example usage: obj.id_to_word(word_id) and returns: self, self