import nltk
parser = nltk.parse.malt.MaltParser(working_dir='/home/rohith/malt-1.7.2',
    mco='engmalt.linear-1.7', additional_java_args=['-Xmx512m'])
txt = 'This is a test sentence'
graph = parser.raw_parse(txt)
How to use malt parser in python nltk