docstr: This new iterator is for DKN's item-to-item recommendations version.
  The tutorial can be found `on this notebook <https://github.com/microsoft/recommenders/blob/main/examples/07_tutorials/KDD2020-tutorial/step4_run_dkn_item2item.ipynb>`_.
  
  Compared with user-to-item recommendations, we don't need the user behavior module.
  So the placeholder can be simplified from the original DKNTextIterator.
  
  Args:
      hparams (object): Global hyper-parameters.
      graph (object): The running graph.
docstr_tok: ["This","new","iterator","is","for","DKN","'s","item-to-item","recommendations","version",".","The","tutorial","can","be","found","`","on","this","notebook","<","https",":","\/\/github.com\/microsoft\/recommenders\/blob\/main\/examples\/07_tutorials\/KDD2020-tutorial\/step4_run_dkn_item2item.ipynb",">","`","_",".","Compared","with","user-to-item","recommendations",",","we","do","n't","need","the","user","behavior","module",".","So","the","placeholder","can","be","simplified","from","the","original","DKNTextIterator",".","Args",":","hparams","(","object",")",":","Global","hyper-parameters",".","graph","(","object",")",":","The","running","graph","."]
code: def __init__(self, hparams, graph):
      """This new iterator is for DKN's item-to-item recommendations version.
      The tutorial can be found `on this notebook <https://github.com/microsoft/recommenders/blob/main/examples/07_tutorials/KDD2020-tutorial/step4_run_dkn_item2item.ipynb>`_.
  
      Compared with user-to-item recommendations, we don't need the user behavior module.
      So the placeholder can be simplified from the original DKNTextIterator.
  
      Args:
          hparams (object): Global hyper-parameters.
          graph (object): The running graph.
      """
      self.hparams = hparams
      self.graph = graph
      self.neg_num = hparams.neg_num
      self.batch_size = hparams.batch_size * (self.neg_num + 2)
      self.doc_size = hparams.doc_size
      with self.graph.as_default():
          self.candidate_news_index_batch = tf.compat.v1.placeholder(
              tf.int64,
              [self.batch_size, self.doc_size],
              name="candidate_news_index",
          )
          self.candidate_news_entity_index_batch = (
              tf.compat.v1.placeholder(
                  tf.int64,
                  [self.batch_size, self.doc_size],
                  name="candidate_news_entity_index",
              )
          )
  
      self._loading_nessary_files()
  
imports: import tensorflow
  from recommenders.models.deeprec.io.dkn_iterator import DKNTextIterator
label_desc: Use image node_id 1 to create a new DKNItem2itemTextIterator object from inherited base classes: DKNTextIterator with example: obj = DKNItem2itemTextIterator(hparams, graph)