Python and .NET integration

NLTK is pure-python and thus can be made to run on IronPython easily. A search turned up this ticket - all one has to do is install a couple of extra Python libraries that don't come by default with IronPython.

This is probably the easiest way for you to integrate. Otherwise, you'll have to either run Python as a subprocess, which sounds complex, or run Python as a server that answers your requests. This is probably the most scalable, though complex, approach. If you go this way, consider Twisted to simplify the server code.

But do try IronPython first...


I don't know why you have a problem with IronPython. you can still use any and all nltk calls there.

To answer your question about porting a Python class into C#: try compiling your python code into an EXE. This creates a DLL with all your python classes in it. This is something that has been around for a while and it has worked like a charm for me in the past


Just an Idea

How about running Python behind as a server, and connect it from .NET with socket?

Since NLTK loading take time and better load it in advance anyway.