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 regular expressions for NER

Regular expressions can be used to identify entities in a document. We will investigate two general approaches:

  • The first one uses regular expressions as supported by Java. These can be useful in situations where the entities are relatively simple and consistent in their form.
  • The second approach uses classes designed to specifically use regular expressions. To demonstrate this, we will use LingPipe's RegExChunker class.

When working with regular expressions, it is advantageous to avoid reinventing the wheel. There are many sources for predefined and tested expressions. One such library can be found at http://regexlib.com/Default.aspx. We will use several of the regular expressions in this library for our examples. ...

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