class_docstr: DKN model (Deep Knowledge-Aware Network)
  
  :Citation:
  
      H. Wang, F. Zhang, X. Xie and M. Guo, "DKN: Deep Knowledge-Aware Network for News
      Recommendation", in Proceedings of the 2018 World Wide Web Conference on World
      Wide Web, 2018.
class_docstr_tok: ["DKN","model","(","Deep","Knowledge-Aware","Network",")",":","Citation",":","H.","Wang",",","F.","Zhang",",","X.","Xie","and","M.","Guo",",","``","DKN",":","Deep","Knowledge-Aware","Network","for","News","Recommendation","''",",","in","Proceedings","of","the","2018","World","Wide","Web","Conference","on","World","Wide","Web",",","2018","."]
docstr: infer document embedding with current model.
  
  Args:
      infile_name (str): Input file name, format is [Newsid] [w1,w2,w3...] [e1,e2,e3...]
      outfile_name (str): Output file name, format is [Newsid] [embedding]
  
  Returns:
      object: An instance of self.
docstr_tok: ["infer","document","embedding","with","current","model",".","Args",":","infile_name","(","str",")",":","Input","file","name",",","format","is","[","Newsid","]","[","w1",",","w2",",","w3","...","]","[","e1",",","e2",",","e3","...","]","outfile_name","(","str",")",":","Output","file","name",",","format","is","[","Newsid","]","[","embedding","]","Returns",":","object",":","An","instance","of","self","."]
code: def run_get_embedding(self, infile_name, outfile_name):
      """infer document embedding with current model.
  
      Args:
          infile_name (str): Input file name, format is [Newsid] [w1,w2,w3...] [e1,e2,e3...]
          outfile_name (str): Output file name, format is [Newsid] [embedding]
  
      Returns:
          object: An instance of self.
      """
      load_sess = self.sess
      with tf.io.gfile.GFile(outfile_name, "w") as wt:
          for (
              batch_data_input,
              newsid_list,
              data_size,
          ) in self.iterator.load_infer_data_from_file(infile_name):
              news_embedding = self.infer_embedding(
                  load_sess, batch_data_input
              )[0]
              for i in range(data_size):
                  wt.write(
                      newsid_list[i]
                      + " "
                      + ",".join(
                          [
                              str(embedding_value)
                              for embedding_value in news_embedding[i]
                          ]
                      )
                      + "\n"
                  )
      return self
  
file_path: recommenders/recommenders/models/deeprec/models/dkn.py
imports: import numpy
  import tensorflow
  from recommenders.models.deeprec.models.base_model import BaseModel
label_desc: Use image node_id 10 for calling the DKN obj's underlying member method code with example usage: obj.run_get_embedding(infile_name, outfile_name) and returns: self