NLP4J ™

# What is NLP4J?

NLP4J ™ is a Natural Language Proccessing platform.

See also
Natural Language Processing with Groovy, OpenNLP, CoreNLP, Nlp4j, Datumbox, Smile, Spark NLP, DJL and TensorFlow

The Apache Groovy programming language - Blogs - Natural Language Processing with Groovy, OpenNLP, CoreNLP, Nlp4j, Datumbox, Smile, Spark NLP, DJL and TensorFlow
ThispostlooksatnumerouscommonnaturallanguageprocessingtasksusingGroovyandarangeofNLPlibraries.

NLP4J Example for English NLP

Document doc = new DefaultDocument();
doc.putAttribute("text", "I eat sushi with chopsticks."); // English Text
StanfordPosAnnotator ann = new StanfordPosAnnotator(); // Annotator for English
ann.setProperty("target", "text"); // set target field
ann.annotate(doc); // Do annotation
for (Keyword kwd : doc.getKeywords()) { // List keywords
    System.err.println(kwd);
}
// -> output
// I [facet=word.PRP, str=I]
// eat [facet=word.VBP, str=eat]
// sushi [facet=word.NN, str=sushi]
// with [facet=word.IN, str=with]
// chopstick [facet=word.NNS, str=chopsticks]
// . [facet=word.., str=.]

see StanfordPosAnnotatorExample0.java for detail.

NLP4J Example for Japanese Language NLP (Morphological analysis) 日本語形態素解析

Document doc = new DefaultDocument();
doc.putAttribute("text", "私は学校に行きました。"); // Japanese text 日本語
KuromojiAnnotator annotator = new KuromojiAnnotator(); // Annotator for Japanese Language
annotator.setProperty("target", "text"); // Set target field
annotator.annotate(doc); // Do annotation
for (Keyword kwd : doc.getKeywords()) { // List Keywords
	System.err.println(kwd);
}
// -> output
// 学校 [facet=名詞, str=学校]
// に [facet=助詞, str=に]
// 行く [facet=動詞, str=行き]
// ます [facet=助動詞, str=まし]
// た [facet=助動詞, str=た]
// 。 [facet=記号, str=。]

see KuromojiAnnotatorExample0.java for detail.

Maven settings for English NLP

  1. https://mvnrepository.com/artifact/org.nlp4j/nlp4j-stanford
  2. https://mvnrepository.com/artifact/edu.stanford.nlp/stanford-corenlp
  3. https://mvnrepository.com/artifact/edu.stanford.nlp/stanford-corenlp

Maven settings for Japanese NLP


Recent Posts

Qiita Document (in Japanese)

NLP4J – Javaで自然言語処理 Index
https://qiita.com/oyahiroki/items/ba79a759c599d3459d29

Author Contact

Hiroki Oya 大矢裕己
2001-2018 IBM Japan Software Lab.
2018- Nissan Motor Co Ltd. Connected Car Service Dev
2021- IBM Japan Software Lab
https://twitter.com/oyahiroki
https://www.linkedin.com/in/oyahiroki/

TradeMarks

NLP4J™ is registered trademarks in Japan by Hiroki Oya

「NLP4J™」は日本における登録商標です

Trademark Inquiry – j-platpat.input.go.jp

商標出願2021-117961 – j-platpat.inpit.go.jp