Can anyone tell me how to use a pre-trained MaltParser model (http://maltparser.org/mco/english_parser/engmalt.html) in nltk.parse.malt? The only option seems to be to train from a file (If anyone could point me in the direction of a good, publicly available training file, that would be great, too).
The MaltParser interface in older versions of NLTK used to hardcode the path to the model. This was fixed in commit e9e443. You can now do the following:
maltparser = MaltParser(mco="/path/to/your/model.mco")
As of this writing, easy_install and pip still install a version of NLTK that doesn't include this fix (2.0.1rc4). If you cannot afford switching to a bleeding edge version, you could use the following hack:
maltparser = MaltParser()
maltparser.mco = "/path/to/your/model.mco"
Pre-trained models can be found on MaltParser's official website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With