code: def read_vocab_list(path, max_vocab_size=20000):
      vocab = {"<eos>": 0, "<unk>": 1}
      with io.open(path, encoding="utf-8", errors="ignore") as f:
          for l in f:
              w = l.strip()
              if w not in vocab and w:
                  vocab[w] = len(vocab)
              if len(vocab) >= max_vocab_size:
                  break
      return vocab
  
file_path: chainer/examples/text_classification/nlp_utils.py
imports: import collections
  import io
  import numpy
  import chainer
label_desc: Use image node_id 4 for calling a global function with example usage: read_vocab_list(path, max_vocab_size) and returns: vocab