O'Reilly logo

Natural Language Processing with Java and LingPipe Cookbook by Krishna Dayanidhi, Breck Baldwin

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

A simple classifier

This recipe is a thought experiment that should help make clear what machine learning does. Recall the Training your own language model classifier recipe in Chapter 1, Simple Classifiers, to train your own sentiment classifier in the recipe. Consider what a conservative approach to the same problem might be—build Map<String,String> from the inputs to the correct class. This recipe will explore how this might work and what its consequences might be.

How to do it...

Brace yourself; this will be spectacularly stupid but hopefully informative.

  1. Enter the following in the command line:
    java -cp lingpipe-cookbook.1.0.jar:lib/lingpipe-4.1.0.jar:lib/opencsv-2.4.jar com.lingpipe.cookbook.chapter3.OverfittingClassifier
    
  2. The usual anemic prompt ...

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