class_docstr: Data loader for the DKN model.
  DKN requires a special type of data format, where each instance contains a label, the candidate news article,
  and user's clicked news article. Articles are represented by title words and title entities. Words and entities
  are aligned.
  
  Iterator will not load the whole data into memory. Instead, it loads data into memory
  per mini-batch, so that large files can be used as input data.
class_docstr_tok: ["Data","loader","for","the","DKN","model",".","DKN","requires","a","special","type","of","data","format",",","where","each","instance","contains","a","label",",","the","candidate","news","article",",","and","user","'s","clicked","news","article",".","Articles","are","represented","by","title","words","and","title","entities",".","Words","and","entities","are","aligned",".","Iterator","will","not","load","the","whole","data","into","memory",".","Instead",",","it","loads","data","into","memory","per","mini-batch",",","so","that","large","files","can","be","used","as","input","data","."]
docstr: Construct a dictionary that maps graph elements to values.
  
  Args:
      data_dict (dict): a dictionary that maps string name to numpy arrays.
  
  Returns:
      dict: A dictionary that maps graph elements to numpy arrays.
docstr_tok: ["Construct","a","dictionary","that","maps","graph","elements","to","values",".","Args",":","data_dict","(","dict",")",":","a","dictionary","that","maps","string","name","to","numpy","arrays",".","Returns",":","dict",":","A","dictionary","that","maps","graph","elements","to","numpy","arrays","."]
code: def gen_infer_feed_dict(self, data_dict):
      """Construct a dictionary that maps graph elements to values.
  
      Args:
          data_dict (dict): a dictionary that maps string name to numpy arrays.
  
      Returns:
          dict: A dictionary that maps graph elements to numpy arrays.
  
      """
      feed_dict = {
          self.candidate_news_index_batch: data_dict[
              "candidate_news_index_batch"
          ].reshape([self.batch_size, self.doc_size]),
          self.candidate_news_entity_index_batch: data_dict[
              "candidate_news_entity_index_batch"
          ].reshape([-1, self.doc_size]),
      }
      return feed_dict
  
file_path: recommenders/recommenders/models/deeprec/io/dkn_iterator.py
imports: import tensorflow
  import numpy
  from recommenders.models.deeprec.io.iterator import BaseIterator
label_desc: Use image node_id 8 for calling the DKNTextIterator obj's underlying member method code with example usage: obj.gen_infer_feed_dict(data_dict) and returns: feed_dict