docstr: Returns a dataframe using _lambda to calculate term relevance of a given topic.
docstr_tok: ["Returns","a","dataframe","using","_lambda","to","calculate","term","relevance","of","a","given","topic","."]
code: def sorted_terms(self, topic=1, _lambda=1):
      """Returns a dataframe using _lambda to calculate term relevance of a given topic."""
      tdf = pd.DataFrame(
          self.topic_info[
              self.topic_info.Category == "Topic" + str(topic)
          ]
      )
      if _lambda < 0 or _lambda > 1:
          _lambda = 1
      stdf = tdf.assign(
          relevance=_lambda * tdf["logprob"]
          + (1 - _lambda) * tdf["loglift"]
      )
      return stdf.sort_values("relevance", ascending=False)
  
imports: import json
  import logging
  import numpy
  import pandas
  from collections import namedtuple
  from joblib import Parallel, delayed, cpu_count
  from scipy.stats import entropy
  from scipy.spatial.distance import pdist, squareform
  from sklearn.manifold import MDS, TSNE
  from pyLDAvis.utils import NumPyEncoder
label_desc: Use image node_id 1 for calling the PreparedData obj's underlying member method code with example usage: obj.sorted_terms(topic, _lambda) and returns: stdf