 <h1>Edited</h1> <p>Note that is answer is no longer working because of the updated version of the MaltParser API in NLTK since August 2015. This answer is kept for legacy sake.</p> <p>Please see this answers to get MaltParser working with NLTK:</p> <ul> <li><a href="http://stackoverflow.com/questions/13207394/step-by-step-to-getting-malt-parser-in-nltk-to-work">Step by step to getting malt parser in NLTK to work?</a></li> </ul> <p><strong>Disclaimer</strong>: This is not an eternal solutions. The answer in the above link (posted on Feb 2016) will work for now. But when MaltParser or NLTK API changes, it might also change the syntax to using MaltParser in NLTK.</p> <hr> <p>A couple problems with your setup:</p> <ul> <li>The input to <code>train_from_file</code> must be a file in CoNLL format, not a pre-trained model. For an <code>mco</code> file, you pass it to the <code>MaltParser</code> constructor using the <code>mco</code> and <code>working_directory</code> parameters.</li> <li>The default java heap allocation is not large enough to load that particular <code>mco</code> file, so you'll have to tell java to use more heap space with the <code>-Xmx</code> parameter. Unfortunately this wasn't possible with the existing code so I just checked in a change to allow an additional constructor parameters for java args. See <a href="https://github.com/nltk/nltk/commit/f63cdccca48c39141f18f79a2cd182f3964eaa93" rel="nofollow">here</a>.</li> </ul> <p>So here's what you need to do:</p> <p>First, get the latest NLTK revision:</p> <pre><code>git clone https://github.com/nltk/nltk.git </code></pre> <p>(NOTE: If you can't use the git version of NLTK, then you'll have to update the file <code>malt.py</code> manually or copy it from <a href="https://github.com/nltk/nltk/blob/master/nltk/parse/malt.py" rel="nofollow">here</a> to have your own version.)</p> <p>Second, rename the jar file to <code>malt.jar</code>, which is what NLTK expects:</p> <pre><code>cd /usr/lib/ ln -s maltparser-1.7.2.jar malt.jar </code></pre> <p>Then add an environment variable pointing to malt parser:</p> <pre><code>export MALTPARSERHOME="/Users/dhg/Downloads/maltparser-1.7.2" </code></pre> <p>Finally, load and use malt parser in python:</p> <pre><code>&gt;&gt;&gt; import nltk &gt;&gt;&gt; parser = nltk.parse.malt.MaltParser(working_dir="/home/rohith/malt-1.7.2", ... mco="engmalt.linear-1.7", ... additional_java_args=['-Xmx512m']) &gt;&gt;&gt; txt = "This is a test sentence" &gt;&gt;&gt; graph = parser.raw_parse(txt) &gt;&gt;&gt; graph.tree().pprint() '(This (sentence is a test))' </code></pre>