docstr: Given an example document, recommends documents similar to it
  from the set of documents supplied to build().
  
  Args:
      texts(list of str): list of document texts.  Mutually-exclusive with <doc_topics>
      doc_topics(ndarray): pre-computed topic distribution for each document in texts.
                           Mutually-exclusive with <texts>.
      n (int): number of recommendations to return
  Returns:
      list of tuples: each tuple is of the form:
                      (text, doc_id, topic_probability, topic_id)
docstr_tok: ["Given","an","example","document",",","recommends","documents","similar","to","it","from","the","set","of","documents","supplied","to","build","(",")",".","Args",":","texts","(","list","of","str",")",":","list","of","document","texts",".","Mutually-exclusive","with","<","doc_topics",">","doc_topics","(","ndarray",")",":","pre-computed","topic","distribution","for","each","document","in","texts",".","Mutually-exclusive","with","<","texts",">",".","n","(","int",")",":","number","of","recommendations","to","return","Returns",":","list","of","tuples",":","each","tuple","is","of","the","form",":","(","text",",","doc_id",",","topic_probability",",","topic_id",")"]
code: def recommend(self, text=None, doc_topic=None, n=5, n_neighbors=100):
      """
      Given an example document, recommends documents similar to it
      from the set of documents supplied to build().
  
      Args:
          texts(list of str): list of document texts.  Mutually-exclusive with <doc_topics>
          doc_topics(ndarray): pre-computed topic distribution for each document in texts.
                               Mutually-exclusive with <texts>.
          n (int): number of recommendations to return
      Returns:
          list of tuples: each tuple is of the form:
                          (text, doc_id, topic_probability, topic_id)
  
      """
      # error-checks
      if text is not None and doc_topic is not None:
          raise ValueError("text is mutually-exclusive with doc_topic")
      if text is None and doc_topic is None:
          raise ValueError("One of text or doc_topic is required.")
      if text is not None and type(text) not in [str]:
          raise ValueError("text must be a str ")
      if doc_topic is not None and type(doc_topic) not in [np.ndarray]:
          raise ValueError("doc_topic must be a np.ndarray")
  
      if n > n_neighbors:
          n_neighbors = n
  
      x_test = [doc_topic]
      if text:
          x_test = self.predict([text])
      docs = self.get_docs()
      indices = self.recommender.kneighbors(
          x_test, return_distance=False, n_neighbors=n_neighbors
      )
      results = [doc for i, doc in enumerate(docs) if i in indices]
      return results[:n]
  
imports: import time
  from ..None import utils
  from ..imports import *
  from .None import preprocessor
  from .None import textutils
label_desc: Use image node_id 17 for calling the TopicModel obj's underlying member method code with example usage: obj.recommend(text, doc_topic, n, n_neighbors) and returns: results