Java Reference
In-Depth Information
}
}
System.out.println();
The singular nouns are displayed for each sentence as shown here:
NN Tagged: voyage Abraham Lincoln time incident
NN Tagged: circumstance dexterity Ned Land confidence
NN Tagged: June frigate whalers nothing narwhal
NN Tagged: captain Monroe Ned Land board Abraham Lincoln
help whale sight
Using the MaxentTagger class to tag textese
We can use a different model to handle twitter text that may include textese. The GATE
( https://gate.ac.uk/wiki/twitter-postagger.html ) has developed a model for twitter text. The
model is used here to process textese:
MaxentTagger tagger = new MaxentTagger(getModelDir()
+ "//gate-EN-twitter.model");
Here, we use the MaxentTagger class' tagString method from the What makes POS
difficult? section earlier in this chapter to process the textese:
System.out.println(tagger.tagString("AFAIK she H8 cth!"));
System.out.println(tagger.tagString(
"BTW had a GR8 tym at the party BBIAM."));
The output will be as follows:
AFAIK_NNP she_PRP H8_VBP cth!_NN
BTW_UH had_VBD a_DT GR8_NNP tym_NNP at_IN the_DT party_NN
BBIAM._NNP
Using Stanford pipeline to perform tagging
We have used the Stanford pipeline in several previous examples. In this example, we will
use the Stanford pipeline to extract POS tags. As with our previous Stanford examples, we
create a pipeline based on a set of annotators: tokenize , ssplit , and pos .
Search WWH ::




Custom Search