Calling Mallet from Python

By summer's end, I would like to elaborate the Python prototype discussed below quite a bit. I hope to be able to read in a directory of text files, run a topic modelling routine on those files, and then map trends in topic-specific sentiment over time with something like a modified conditional frequency distribution plot. One of the difficulties I have faced in allowing the sentiment classifier prototype to accomplish these objectives, however, is that I haven't been able to evoke the MALLET topic modeller from within Python. Although I can run MALLET from the command line, and although others are able to evoke MALLET in Python with the call_mallet() method in the NLTK, I have not been able to employ this method in a Windows environment. After dashing my hopes for MALLET via the NLTK package in Windows, though, I realized that one can send a command right to a shell using the call() method in the subprocess module, and it wasn't long before I was able to use the linked code to evoke MALLET in a Python environment.

One small step forward. The next step will involve figuring out how to parse lexical dependencies in Python so that I can start using methods of grammatical analysis to analyze topic-specific sentiment.