Posts

Showing posts from October, 2013

Creating a simple TCP server in Java and using it from Python – to use the Stanford POS tagger

Image
As the advanced network protocols flood the market we forgot how easy it is to create a simple server and a client if we want to integrate two different platforms – Java and Python in this case. The standard TCP socket library is there on practically every platform so connecting to a simple TCP server or actually creating one is just a couple of lines even in C. If we need to, we can build more complex protocols and use more complex document formats, but it's important to remember that we don't need it all the time. POS tagging For one of my projects, I needed to use the Stanford POS tagger to parse a large text corpus. Even though there are Python POS taggers , my favourite one is by far the Java based Stanford implementation. Usually I use it directly from Java, but in this case the input file was a bit tricky to parse and Python did it very well so I just wanted to do the POS tagging in Java and everything else in Python. My first thought was to create a file base