def main_restore_embedding_layer():
<EOL>vocabulary_size = <NUM_LIT><EOL>embedding_size = <NUM_LIT><EOL>model_file_name = "<STR_LIT>"<EOL>batch_size = None<EOL>print("<STR_LIT>")<EOL>all_var = tl.files.load_npy_to_any(name=model_file_name + '<STR_LIT>')<EOL>data = all_var['<STR_LIT:data>']<EOL>count = all_var['<STR_LIT:count>']<EOL>dictionary = all_var['<STR_LIT>']<EOL>reverse_dictionary = all_var['<STR_LIT>']<EOL>tl.nlp.save_vocab(count, name='<STR_LIT>' + model_file_name + '<STR_LIT>')<EOL>del all_var, data, count<EOL>load_params = tl.files.load_npz(name=model_file_name + '<STR_LIT>')<EOL>x = tf.placeholder(tf.int32, shape=[batch_size])<EOL>emb_net = tl.layers.EmbeddingInputlayer(x, vocabulary_size, embedding_size, name='<STR_LIT>')<EOL>sess.run(tf.global_variables_initializer())<EOL>tl.files.assign_params(sess, [load_params[<NUM_LIT:0>]], emb_net)<EOL>emb_net.print_params()<EOL>emb_net.print_layers()<EOL>word = b'<STR_LIT:hello>'<EOL>word_id = dictionary[word]<EOL>print('<STR_LIT>', word_id)<EOL>words = [b'<STR_LIT:i>', b'<STR_LIT>', b'<STR_LIT>', b'<STR_LIT>']<EOL>word_ids = tl.nlp.words_to_word_ids(words, dictionary, _UNK)<EOL>context = tl.nlp.word_ids_to_words(word_ids, reverse_dictionary)<EOL>print('<STR_LIT>', word_ids)<EOL>print('<STR_LIT>', context)<EOL>vector = sess.run(emb_net.outputs, feed_dict={x: [word_id]})<EOL>print('<STR_LIT>', vector.shape)<EOL>vectors = sess.run(emb_net.outputs, feed_dict={x: word_ids})<EOL>print('<STR_LIT>', vectors.shape)<EOL>
How to use Embedding layer, and how to convert IDs to vector,
    IDs to words, etc.