class_docstr: Uses an ExpansionModel to expand the set of query terms based on the top
  N result documents.
docstr: Returns the N most important terms in the vectors added so far.
  
  :param number: The number of terms to return.
  :param normalize: Whether to normalize the weights.
  :returns: A list of ("term", weight) tuples.
docstr_tok: ["Returns","the","N","most","important","terms","in","the","vectors","added","so","far",".",":","param","number",":","The","number","of","terms","to","return",".",":","param","normalize",":","Whether","to","normalize","the","weights",".",":","returns",":","A","list","of","(","``","term","''",",","weight",")","tuples","."]
code: def expanded_terms(self, number, normalize=True):
      """Returns the N most important terms in the vectors added so far.
  
      :param number: The number of terms to return.
      :param normalize: Whether to normalize the weights.
      :returns: A list of ("term", weight) tuples.
      """
  
      model = self.model
      fieldname = self.fieldname
      ixreader = self.ixreader
      field = ixreader.schema[fieldname]
      tlist = []
      maxweight = 0
  
      # If no terms have been added, return an empty list
      if not self.topN_weight:
          return []
  
      for word, weight in iteritems(self.topN_weight):
          btext = field.to_bytes(word)
          if (fieldname, btext) in ixreader:
              cf = ixreader.frequency(fieldname, btext)
              score = model.score(weight, cf, self.top_total)
              if score > maxweight:
                  maxweight = score
              tlist.append((score, word))
  
      if normalize:
          norm = model.normalizer(maxweight, self.top_total)
      else:
          norm = maxweight
      tlist = [(weight / norm, t) for weight, t in tlist]
      tlist.sort(key=lambda x: (0 - x[0], x[1]))
  
      return [(t, weight) for weight, t in tlist[:number]]
  
imports: from __future__ import division
  import random
  from collections import defaultdict
  from math import log
  from whoosh.compat import xrange, iteritems
label_desc: Use image node_id 5 for calling the Expander obj's underlying member method code with example usage: obj.expanded_terms(number, normalize) and returns: unknown, list