docstr: This function will return a mini-batch of data with features,
  by looking up `news_word_index` dictionary and `news_entity_index` dictionary according to the news article's ID.
  
  Args:
      infile (str): File path. Each line of `infile` is a news article's ID.
  
  Yields:
      dict, list, int:
      - A dictionary that maps graph elements to numpy arrays.
      - A list with news article's ID.
      - Size of the data in a batch.
docstr_tok: ["This","function","will","return","a","mini-batch","of","data","with","features",",","by","looking","up","`","news_word_index","`","dictionary","and","`","news_entity_index","`","dictionary","according","to","the","news","article","'s","ID",".","Args",":","infile","(","str",")",":","File","path",".","Each","line","of","`","infile","`","is","a","news","article","'s","ID",".","Yields",":","dict",",","list",",","int",":","-","A","dictionary","that","maps","graph","elements","to","numpy","arrays",".","-","A","list","with","news","article","'s","ID",".","-","Size","of","the","data","in","a","batch","."]
code: def load_data_from_file(self, infile):
      """This function will return a mini-batch of data with features,
      by looking up `news_word_index` dictionary and `news_entity_index` dictionary according to the news article's ID.
  
      Args:
          infile (str): File path. Each line of `infile` is a news article's ID.
  
      Yields:
          dict, list, int:
          - A dictionary that maps graph elements to numpy arrays.
          - A list with news article's ID.
          - Size of the data in a batch.
      """
      newsid_list = []
      candidate_news_index_batch = []
      candidate_news_entity_index_batch = []
      cnt = 0
      with open(infile, "r") as rd:
          while True:
              line = rd.readline()
              if not line:
                  break
              newsid = line.strip()
              word_index, entity_index = (
                  self.news_word_index[newsid],
                  self.news_entity_index[newsid],
              )
              newsid_list.append(newsid)
  
              candidate_news_index_batch.append(word_index)
              candidate_news_entity_index_batch.append(entity_index)
  
              cnt += 1
              if cnt >= self.batch_size:
                  res = self._convert_infer_data(
                      candidate_news_index_batch,
                      candidate_news_entity_index_batch,
                  )
                  data_size = self.batch_size
                  yield self.gen_infer_feed_dict(
                      res
                  ), newsid_list, data_size
                  candidate_news_index_batch = []
                  candidate_news_entity_index_batch = []
                  newsid_list = []
                  cnt = 0
  
          if cnt > 0:
              data_size = cnt
              while cnt < self.batch_size:
                  candidate_news_index_batch.append(
                      candidate_news_index_batch[cnt % data_size]
                  )
                  candidate_news_entity_index_batch.append(
                      candidate_news_entity_index_batch[cnt % data_size]
                  )
                  cnt += 1
              res = self._convert_infer_data(
                  candidate_news_index_batch,
                  candidate_news_entity_index_batch,
              )
              yield self.gen_infer_feed_dict(
                  res
              ), newsid_list, data_size
  
imports: import tensorflow
  from recommenders.models.deeprec.io.dkn_iterator import DKNTextIterator
label_desc: Use image node_id 3 for calling the DKNItem2itemTextIterator obj's underlying member method code with example usage: obj.load_data_from_file(infile) without return types