3

Possible Duplicate:
Java : Is there a good natural language processing library

Can anybody tell me about a library for NLP in java? It would really be nice if is properly documented too. I have tried to work with lingpipe but I am not able to understand it completely.

Community
  • 1
  • 1
agarwav
  • 400
  • 2
  • 8
  • 16

5 Answers5

7

You should try the Stanford - NLP. It has many utilities and libraries for NLP like the Parts-Of-Speech Tagger,all of which are great to use and easy to understand.

Kazekage Gaara
  • 14,972
  • 14
  • 61
  • 108
  • Thanx Kazekage. Have you tried to make a parser with the help of this library? My projects main aim is to process the reviews of the products given by the users on the websites like IMDB, mobile phone reviews etc. So that I can grade them, rate them out of 5 as we generally see on the websites – agarwav Jun 20 '12 at 10:19
  • 1
    I have used their POS-tagger. It is very accurate and pretty simple to use indeed. I worked on a similar application where I had to rate sentences depending on the kind of words in them, and finally only choose those sentences which have a high score. – Kazekage Gaara Jun 20 '12 at 11:43
  • Wow! Cool. This is the actual thing that I need to do. :) Thanx a lot for advice. I will get back to this forum if I face any problem. By the way would it be possible for you to give me some sample code so that I can feel a bit easy? – agarwav Jun 20 '12 at 11:55
  • Kindly accept any of the two answers as the correct answer by clicking on the tick mark below the voting arrows just on left side of the answer. :-) – Kazekage Gaara Jun 20 '12 at 11:57
5

It is probably a bit late now, and I suppose you must have moved on with your project. But you can anyways check this blog out. It has a series of posts on nlp with java. Stanford-NLP, as suggested by others is a great library to work with.

Most of the libraries will help you in the lexical analysis phase (sentence segmentation, tokenization, POS tagging, parsing, etc.) so that you don't have to start your code from scratch. All the best !

Harsh
  • 51
  • 1
  • 2
3

These are 2 other libraries for NLP which you can use.

Stanford NLP Group has an effective combination of sophisticated and deep linguistic modeling and data analysis with innovative probabilistic and machine learning approaches to NLP.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
vikiiii
  • 9,246
  • 9
  • 49
  • 68
  • ok. Thanx a lot Andrew. Can you also tell me any link you know for understanding how to work on Stanford NLP? – agarwav Jun 20 '12 at 10:17
2

I've done some experimenting with Apache OpenNLP with jRuby. Its quite nice and solid but at the time I write this poorly documented. If you try OpenNLP I suggest you read following articles:

Documentation for OpenNLP can be found here.

This is code from my project where I do named entity recognition with OpenNLP. Its written in jRuby. OpenNLP models are stored in database because the code runs on Heroku and you can't write on file system there.

Oto Brglez
  • 4,113
  • 1
  • 26
  • 33
  • 1
    Apache OpenNLP is good & improving with community. Here is a good basic tutorial http://itsallbinary.com/tutorial-natural-language-processing-in-java-using-apache-opennlp/. This has basic custom model training, analyzing inputs & enhancing model by retraining. – Ravi K May 08 '19 at 05:17
1

There is actually a quiet good NLP tool list. It's in german, but should work with google translate. But i list some nevertheless:

If you want the best for english, take Stanford, but its GPL v2. For not such popular languages, Treetagger is better (it just needs a smaller trainingcorpus to work). For example you get better results with TreeTagger on german texts, dont know the survey anymore, but if you want it, i can search for it. OpenNLP is not as good as the other tools, but its under the Apache License v2, which you should consider aswell.

Nicolas
  • 950
  • 1
  • 7
  • 15
  • But treetagger installation is a pain http://stackoverflow.com/questions/15503388/treetagger-installation-successful-but-cannot-open-par-file – alvas Mar 19 '13 at 15:36