April 2019
Beginner to intermediate
386 pages
11h 20m
English
The necessary steps include the following:
import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.util.List;import opennlp.tools.postag.POSModel;import opennlp.tools.postag.POSTaggerME;import opennlp.tools.util.Sequence;
String sampleSentence = "When the mouse saw the cat it ran away.";String words[] = sampleSentence.split(" ");
try (InputStream modelInputStream = new FileInputStream( new File("en-pos-maxent.bin"));) { ...} catch (IOException e) { // Handle exceptions ...Read now
Unlock full access