code: def prepare_data(use_cache=True):
      import pickle
  
      if not os.path.isfile(insuranceQA_cache_fp) or not use_cache:
          # no cache is found, preprocess data from scratch
          print("prepare data from scratch")
  
          # get pretained word vector
          from gensim.models.keyedvectors import KeyedVectors
  
          google_news_pretrain_fp = check_exist_or_download(
              google_news_pretrain_embeddings_link
          )
          wv = KeyedVectors.load_word2vec_format(
              google_news_pretrain_fp, binary=True
          )
  
          # prepare insurance QA dataset
          data_zip = check_exist_or_download(insuranceQA_url)
          data_dir = unzip_data(download_dir, data_zip)
  
          label2answer = get_label2answer(data_dir)
          idx2word = get_idx2word(data_dir)
          idx2vec = get_idx2vec_weights(wv, idx2word)
  
          train_raw = get_train_raw(
              data_dir, insuranceqa_train_filename
          )
          test_raw = get_train_raw(data_dir, insuranceqa_test_filename)
          with open(insuranceQA_cache_fp, "wb") as handle:
              pickle.dump(
                  (
                      train_raw,
                      test_raw,
                      label2answer,
                      idx2word,
                      idx2vec,
                  ),
                  handle,
                  protocol=pickle.HIGHEST_PROTOCOL,
              )
      else:
          # load from cached pickle
          with open(insuranceQA_cache_fp, "rb") as handle:
              (
                  train_raw,
                  test_raw,
                  label2answer,
                  idx2word,
                  idx2vec,
              ) = pickle.load(handle)
  
      return train_raw, test_raw, label2answer, idx2word, idx2vec
  
file_path: singa/examples/qabot/qabot_data.py
imports: import numpy
  import random
  import os
  import urllib
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_data(use_cache) and returns: train_raw,  test_raw,  label2answer,  idx2word,  idx2vec