Natural Language Processing for the Working Programmer
11–20 of 48 posts
Re: Natural Language Processing for the Working Programmer
#12I was working with NLP, and its various toolkits (python-nltk I'm looking at you). The thing about NLP is, there just isn't enough libraries (for humans) to simply plug NLP into use. Even nltk, the premier python library for NLP, seems to be an NLP core-library for building NLP solutions, rather than for building NLP-powered apps. It also seems to extremely unpythonic. Is there a missing link there? I don't know. So…
yeah, for the vast majority of uses, most people really want to do just a fairly small set of things fairly well. NER comes to mind, lots and lots and lots of toolkits for building up to NER, but very few that let submit English text and get back a list of people, places and things without having to virtually build my own NER system from scratch anyways. Give me NER, Entity relationships (ER) and a couple kinds of se…
It's pretty straightforward to use their library to read a document and output an XML file containing NER data (and lots of other fun stuff).
For instance, from the sentence:
> World War II, or the Second World War (often abbreviated as WWII or WW2), was a global military conflict lasting from 1939 to 1945, which involved most of the world's nations, including all of the great powers, eventually forming two opposing military alliances, the Allies and Axis.
Stanford NLP NER will output the following entities:
"World War II" - MISC "Second World War" - MISC "1939 to 1945" - DATE - NORMALIZED 1939/1945 "Axis" - MISC
You can view the output of Stanford's CoreNLP library (NER + dependency grammar + coreference resolution + some other stuff) for the Wikipedia article on World War II in my github repo:
https://raw.github.com/ryantanner/thesis/master/data/ww2samp...
edit: I should add that the real fun (for me) came from combining NER with dependency grammars and coreference resolution. It makes it very easy to turn Stanford NLP's output into a knowledge graph combining a large number of documents.
Re: Natural Language Processing for the Working Programmer
#13Re: Natural Language Processing for the Working Programmer
#14I'm not that familiar with Haskell and the past week's HN frontpage articles on Monads was just confusing...but what is it about Haskell that makes it more useful for NLP than, say, Python?
Scala (or Java) is another great NLP language. It's got decent libraries (openNLP, mallet, mahout), hadoop, and Scala is almost as nice as Haskell.
Re: Natural Language Processing for the Working Programmer
#15Earlier quoted context omitted.
yeah, for the vast majority of uses, most people really want to do just a fairly small set of things fairly well. NER comes to mind, lots and lots and lots of toolkits for building up to NER, but very few that let submit English text and get back a list of people, places and things without having to virtually build my own NER system from scratch anyways. Give me NER, Entity relationships (ER) and a couple kinds of se…
I've used the Stanford NLP library extensively for NER. I made heavy use of it in my senior thesis project. It's pretty straightforward to use their library to read a document and output an XML file containing NER data (and lots of other fun stuff). For instance, from the sentence: > World War II, or the Second World War (often abbreviated as WWII or WW2), was a global military conflict lasting from 1939 to 1945, whi…
This is a bit more human friendly.
Re: Natural Language Processing for the Working Programmer
#16I'm not that familiar with Haskell and the past week's HN frontpage articles on Monads was just confusing...but what is it about Haskell that makes it more useful for NLP than, say, Python?
Re: Natural Language Processing for the Working Programmer
#17I'm not that familiar with Haskell and the past week's HN frontpage articles on Monads was just confusing...but what is it about Haskell that makes it more useful for NLP than, say, Python?
I've only played around with Haskell and NLP (using this guide, actually), but functional languages are a very nice fit for natural language processing, which often involves pipelining text (in the form of arrays or lists of characters) from function to function (tokenization->tagging->chunking->extraction). This fits the functional paradigm very well. I really like using NLTK (Python) but if I were more comfortable…
You might try to understand monoids first, because you already have familiarity with many applications of monoids. The realization "oh, this is just two functions" at the heart of monoids is also what's at the heart of monads, but the applications are different.
Desugaring helps a lot too. I learned by avoiding do-notation, but you can learn do-notation at the same time if you try desugaring as you go, so you can make explicit what's going on under the covers.
It's like math, you have to keep playing with it until you grok it. I find it's good to try out different expressions in ghci, use :t a lot to see what types are coming back, to build intuition.
If you put a few hours into it for a few days in a row, you can probably get to this epiphany in one weekend. The trick is building up enough examples that your brain can generalize it. Nobody's going to learn it by staring at the abstract form and thinking hard--if we did work that way, there would be a lot more use of comonads. That's why it's important to re-type examples. You're not going to be able to write the examples yourself until you understand them, but working through them gives you something to build on, and builds healthy expectations (I'm going to need return here, because the naked value isn't in the monad, etc.)
The epiphany is worth it--but don't count on a monad tutorial to help you much, they're mainly a side-effect of other people having the epiphany.
Re: Natural Language Processing for the Working Programmer
#18Re: Natural Language Processing for the Working Programmer
#19In the meantime, here's a preview of what it can do. http://goo.gl/Lz7Vr
Re: Natural Language Processing for the Working Programmer
#20Earlier quoted context omitted.
yeah, for the vast majority of uses, most people really want to do just a fairly small set of things fairly well. NER comes to mind, lots and lots and lots of toolkits for building up to NER, but very few that let submit English text and get back a list of people, places and things without having to virtually build my own NER system from scratch anyways. Give me NER, Entity relationships (ER) and a couple kinds of se…
I've used the Stanford NLP library extensively for NER. I made heavy use of it in my senior thesis project. It's pretty straightforward to use their library to read a document and output an XML file containing NER data (and lots of other fun stuff). For instance, from the sentence: > World War II, or the Second World War (often abbreviated as WWII or WW2), was a global military conflict lasting from 1939 to 1945, whi…