docstr: This interface calculates the similarity between query and document.
  
  Args:
      query(str): the input query text.
      document(str): the input document text.
  
  Returns:
      lda_sim(float): likelihood based similarity between query and document
                      based on LDA.
docstr_tok: ["This","interface","calculates","the","similarity","between","query","and","document",".","Args",":","query","(","str",")",":","the","input","query","text",".","document","(","str",")",":","the","input","document","text",".","Returns",":","lda_sim","(","float",")",":","likelihood","based","similarity","between","query","and","document","based","on","LDA","."]
code: def cal_query_doc_similarity(self, query, document):
      """
      This interface calculates the similarity between query and document.
  
      Args:
          query(str): the input query text.
          document(str): the input document text.
  
      Returns:
          lda_sim(float): likelihood based similarity between query and document
                          based on LDA.
      """
      q_tokens = self.__tokenizer.tokenize(query)
      d_tokens = self.__tokenizer.tokenize(document)
  
      doc = LDADoc()
      self.__engine.infer(d_tokens, doc)
      doc_topic_dist = doc.sparse_topic_dist()
  
      sm = SemanticMatching()
      lda_sim = sm.likelihood_based_similarity(
          q_tokens, doc_topic_dist, self.__engine.get_model()
      )
  
      return lda_sim
  
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 4 for calling the TopicModel obj's underlying member method code with example usage: obj.cal_query_doc_similarity(query, document) and returns: lda_sim