apache/opennlp

Apache OpenNLP

Apache OpenNLP – What It Is

Apache OpenNLP is a pure‑Java library that provides ready‑to‑use machine‑learning components for common natural‑language‑processing (NLP) tasks. It lets developers add capabilities such as tokenization, sentence detection, part‑of‑speech tagging, named‑entity recognition, chunking, parsing, coreference resolution, language detection, and spell‑checking to Java applications or data‑processing pipelines.


Key Features (as described in the README)

Feature What It Does
Tokenization & Sentence Segmentation Splits raw text into words and sentences.
POS Tagging Assigns part‑of‑speech labels (noun, verb, etc.) to tokens.
Named Entity Extraction Detects entities like people, locations, organizations.
Chunking & Parsing Groups tokens into phrases and builds syntactic trees.
Coreference Resolution Links pronouns and mentions that refer to the same entity.
Language Detection Identifies the language of a given text snippet.
Stop‑word Filtering Provides built‑in stop‑word lists for 11 languages.
Spell‑checking Uses a SymSpell‑based module for language‑agnostic correction.
ML Algorithms Includes MaxEnt, Perceptron, Naïve Bayes, and SVM classifiers; also supports ONNX models (CPU & GPU).
CLI & API Can be used from the command line or programmatically via a clean Java API.
Modular Architecture Split into many Maven modules (runtime, API, ML implementations, DL adapters, extensions, etc.) so you only pull in what you need.
Integration Friendly Designed to plug into streaming frameworks like Apache Flink, NiFi, and Spark.

How to Get Started

  1. Add the library to your project via Maven or Gradle (e.g., org.apache.opennlp:opennlp-runtime).
  2. Include model support if you need pre‑trained models (opennlp-model-resolver).
  3. Load a model (e.g., a tokenizer model) and invoke the corresponding *ME class, such as TokenizerME.
  4. Run the CLI (opennlp-cli) for quick experiments, training, or evaluation.

The README points to detailed documentation, JavaDocs, and downloadable demo models.


Who Might Use It

  • Java developers building search, chat, or analytics services that need text preprocessing.
  • Data engineers integrating NLP steps into Apache Flink, Spark, or NiFi pipelines.
  • Researchers or hobbyists who want a lightweight, open‑source alternative to heavyweight deep‑learning frameworks for classic NLP tasks.

Project Health & Community

  • Active CI (GitHub Actions) and Maven Central releases.
  • Multiple contributors and a clear branching model (main for 3.x, opennlp-2.x for legacy).
  • Community channels: mailing lists, Slack (Apache‑only), Bluesky, and Stack Overflow tag.
  • Security issues are handled privately via Apache’s security mailing address.

In short: Apache OpenNLP is a mature, Java‑centric toolkit for traditional NLP tasks, offering both classic ML algorithms and ONNX‑based deep‑learning support, with a modular design that fits well into modern Java data‑processing ecosystems.

Related

  • Project
  • Project
  • Project
  • Project
  • Project