title: Python, NLTK: NameError: name 'load_parser' is not defined
body: <p>I'm trying to run this example provided from NLTK book <a href="http://www.nltk.org/book/ch10.html" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>&gt;&gt;&gt; from nltk import load_parser
  &gt;&gt;&gt; cp = load_parser('grammars/book_grammars/sql0.fcfg')
  &gt;&gt;&gt; query = 'What cities are located in China'
  &gt;&gt;&gt; trees = list(cp.parse(query.split()))
  &gt;&gt;&gt; answer = trees[0].label()['SEM']
  &gt;&gt;&gt; answer = [s for s in answer if s]
  &gt;&gt;&gt; q = ' '.join(answer)
  &gt;&gt;&gt; print(q)
  SELECT City FROM city_table WHERE Country="china"
  </code></pre>
  
  <p>but when I type the first line it gives me this error:</p>
  
  <pre><code>NameError: name 'load_parser' is not defined
  </code></pre>
  
  <p>I tried looking for similar questions but none have the same issue. How can I fix it?</p>