Getting ready

To prepare, we need to do the following:

  1. Create a new Maven project.
  2. Add the following dependency to the project's POM file:
<dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-tools</artifactId>
<version>1.9.0</version>
</dependency>
  1. Create a file called sample.train and place it in the root level of your project. Add the following to the file:
We_PRP will_MD start_VB with_IN a_DT simple_JJ sentence._NN 
If_IN we_PRP consider_VBP more_JJR complex_JJ sentences,_NNS we_PRP will_MD find_VB them_PRP to_TO be_VB a_DT bit_RB more_RBR interesting!_JJ
Or_CC we_PRP could_MD consider_VB sentence_NN with_IN different_JJ terminators,_NNS various_JJ element_NN types,_NNS or_CC other_JJ factors._NNS
Should_MD we_PRP do_VB that?_DT
For_IN now,_RB let's_VB just_RB keep_VBP it_PRP simple._JJ
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.250.157