Scripts2026年7月21日·1 分钟阅读

CoreNLP — Stanford Natural Language Processing Toolkit

Production-grade Java NLP toolkit for tokenization, parsing, NER, sentiment analysis, and coreference resolution from Stanford University.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
CoreNLP Overview
先审查命令
npx -y tokrepo@latest install 091c6959-84e1-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

CoreNLP is a battle-tested Java NLP framework created by the Stanford NLP Group. It provides a unified pipeline for applying linguistic annotations — from basic tokenization to deep parsing, named entity recognition, sentiment analysis, and coreference resolution — to arbitrary text in multiple languages.

What CoreNLP Does

  • Runs a full NLP pipeline (tokenize, sentence-split, POS-tag, lemmatize, NER, parse, sentiment, coref) in a single pass
  • Provides a REST server so any language can call it over HTTP with JSON output
  • Supports rule-based, statistical, and neural models for each annotator
  • Handles multiple human languages including English, Chinese, Arabic, French, German, and Spanish
  • Offers both programmatic Java API and command-line interface for batch processing

Architecture Overview

CoreNLP is built around an annotation pipeline: a document enters as raw text and flows through a configurable chain of annotators, each adding a layer of linguistic structure. Annotators are loaded lazily and can be mixed and matched via a properties file. Under the hood, models range from CRF-based sequence taggers to shift-reduce constituency parsers and a neural-network coreference resolver. The optional server mode wraps the pipeline behind a Jetty HTTP endpoint.

Self-Hosting & Configuration

  • Requires Java 8 or later; download the zip from the Stanford NLP website and run with java -cp
  • Memory allocation is critical — use -mx4g or higher for English models; Chinese models may need 8 GB+
  • Customize annotators via a corenlp.properties file or URL query parameters
  • Deploy as a Docker container using community-maintained images for reproducible environments
  • For production, place behind a reverse proxy and limit concurrent requests to control memory usage

Key Features

  • Over 15 years of academic research backing each annotator with peer-reviewed accuracy benchmarks
  • Deterministic rule-based components (TokensRegex, Semgrex, Tregex) for pattern-based extraction
  • Multilingual support covering 6+ languages with downloadable model jars
  • Temporal expression normalization (SUTime) for extracting and grounding dates and times
  • Relation extraction and knowledge-base population annotators for structured information extraction

Comparison with Similar Tools

  • spaCy — Python-native, faster for production NLP but fewer deep-linguistic annotators than CoreNLP
  • Stanza — Stanford's own Python library built on neural models; lighter than CoreNLP but lacks rule-based components
  • NLTK — Educational toolkit with wide coverage but slower and less production-ready
  • Hugging Face Transformers — Excels at transformer-based tasks but requires building your own pipeline around individual models
  • Apache OpenNLP — Lightweight Java alternative with smaller model footprint but fewer annotators

FAQ

Q: Is CoreNLP free to use commercially? A: CoreNLP is released under the GPL v2 license. Commercial licensing is available through Stanford for proprietary use.

Q: How does CoreNLP compare to modern transformer models? A: CoreNLP's neural components are competitive on standard benchmarks. For cutting-edge accuracy on specific tasks, fine-tuned transformers may outperform it, but CoreNLP offers a ready-made, integrated pipeline.

Q: Can I use CoreNLP from Python? A: Yes — either call the CoreNLP server via HTTP from Python or use the Stanza library, which provides a Python interface to CoreNLP.

Q: What is the minimum hardware requirement? A: English models need roughly 4 GB of RAM. A modern multi-core CPU is recommended; GPU acceleration is not used by the default pipeline.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产