O'Reilly logo

Natural Language Processing with Java by Richard M Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the NLP APIs

We will demonstrate POS tagging using OpenNLP, Stanford API, and LingPipe. Each of the examples will use the following sentence. It is the first sentence of Chapter 5, At A Venture of Twenty Thousands Leagues Under the Sea by Jules Verne:

private String[] sentence = {"The", "voyage", "of", "the", 
    "Abraham", "Lincoln", "was", "for", "a", "long", "time", "marked", 
    "by", "no", "special", "incident."};

The text to be processed may not always be defined in this fashion. Sometimes the sentence will be available as a single string:

String theSentence = "The voyage of the Abraham Lincoln was for a " 
    + "long time marked by no special incident.";

We might need to convert a string to an array of strings. There are numerous techniques for converting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required