docstr: This interface can be used to find topk keywords of document.
  
  Args:
      document(str): the input document text.
      top_k(int): top k keywords of this document.
  
  Returns:
      results(list): contains top_k keywords and their corresponding
                     similarity compared to document.
docstr_tok: ["This","interface","can","be","used","to","find","topk","keywords","of","document",".","Args",":","document","(","str",")",":","the","input","document","text",".","top_k","(","int",")",":","top","k","keywords","of","this","document",".","Returns",":","results","(","list",")",":","contains","top_k","keywords","and","their","corresponding","similarity","compared","to","document","."]
code: def cal_doc_keywords_similarity(self, document, top_k=10):
      """
      This interface can be used to find topk keywords of document.
  
      Args:
          document(str): the input document text.
          top_k(int): top k keywords of this document.
  
      Returns:
          results(list): contains top_k keywords and their corresponding
                         similarity compared to document.
      """
      d_tokens = self.__tokenizer.tokenize(document)
  
      # Do topic inference on documents to obtain topic distribution.
      doc = LDADoc()
      self.__engine.infer(d_tokens, doc)
      doc_topic_dist = doc.sparse_topic_dist()
  
      items = []
      words = set()
      for word in d_tokens:
          if word in words:
              continue
          words.add(word)
          wd = WordAndDis()
          wd.word = word
          sm = SemanticMatching()
          wd.distance = sm.likelihood_based_similarity(
              terms=[word],
              doc_topic_dist=doc_topic_dist,
              model=self.__engine.get_model(),
          )
          items.append(wd)
  
      def take_elem(word_dis):
          return word_dis.distance
  
      items.sort(key=take_elem, reverse=True)
  
      results = []
      size = len(items)
      for i in range(top_k):
          if i >= size:
              break
          results.append(
              {"word": items[i].word, "similarity": items[i].distance}
          )
  
      return results
  
file_path: PaddleHub/modules/text/language_model/lda_novel/module.py
imports: import os
  import paddlehub
  from paddlehub.module.module import moduleinfo
  from paddlehub.common.logger import logger
  from lda_novel.inference_engine import InferenceEngine
  from lda_novel.document import LDADoc, SLDADoc
  from lda_novel.semantic_matching import SemanticMatching, WordAndDis
  from lda_novel.tokenizer import LACTokenizer, SimpleTokenizer
  from lda_novel.config import ModelType
  from lda_novel.vocab import Vocab, WordCount
label_desc: Use image node_id 3 for calling the TopicModel obj's underlying member method code with example usage: obj.cal_doc_keywords_similarity(document, top_k) and returns: results, word_dis