title: Query To IDF Vector
body: <p>I am having trouble trying to convert a list of query terms into a dict mapping term to inverse document frequency. The formula needed is: 
  log(N / df(term)), where N is number of documents and df(term) is the number of documents that term appears in.</p>
  
  <p>def q_to_v(index)</p>
  
  <p>ex.
  Input: ["cat", "dog"]</p>
  
  <p>Output: {"cat":0.2, "dog": 0.7}</p>
  
  <p>All help is much appreciated</p>