MCPcopy Index your code
hub / github.com/stanfordnlp/CoreNLP

github.com/stanfordnlp/CoreNLP @v4.5.10 sqlite

repository ↗ · DeepWiki ↗ · release v4.5.10 ↗
32,824 symbols 122,376 edges 2,147 files 13,312 documented · 41%
README

Stanford CoreNLP

Run Tests Maven Central Twitter

Stanford CoreNLP provides a set of natural language analysis tools written in Java. It can take raw human language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize and interpret dates, times, and numeric quantities, mark up the structure of sentences in terms of syntactic phrases or dependencies, and indicate which noun phrases refer to the same entities. It was originally developed for English, but now also provides varying levels of support for (Modern Standard) Arabic, (mainland) Chinese, French, German, Hungarian, Italian, and Spanish. Stanford CoreNLP is an integrated framework, which makes it very easy to apply a bunch of language analysis tools to a piece of text. Starting from plain text, you can run all the tools with just two lines of code. Its analyses provide the foundational building blocks for higher-level and domain-specific text understanding applications. Stanford CoreNLP is a set of stable and well-tested natural language processing tools, widely used by various groups in academia, industry, and government. The tools variously use rule-based, probabilistic machine learning, and deep learning components.

The Stanford CoreNLP code is written in Java and licensed under the GNU General Public License (v2 or later). Note that this is the full GPL, which allows many free uses, but not its use in proprietary software that you distribute to others.

Build Instructions

Several times a year we distribute a new version of the software, which corresponds to a stable commit.

During the time between releases, one can always use the latest, under development version of our code.

Here are some helpful instructions to use the latest code:

Provided build

Sometimes we will provide updated jars here which have the latest version of the code.

At present, the current released version of the code is our most recent released jar, though you can always build the very latest from GitHub HEAD yourself.

Build with Ant

  1. Make sure you have Ant installed, details here: http://ant.apache.org/
  2. Compile the code with this command: cd CoreNLP ; ant
  3. Then run this command to build a jar with the latest version of the code: cd CoreNLP/classes ; jar -cf ../stanford-corenlp.jar edu
  4. This will create a new jar called stanford-corenlp.jar in the CoreNLP folder which contains the latest code
  5. The dependencies that work with the latest code are in CoreNLP/lib and CoreNLP/liblocal, so make sure to include those in your CLASSPATH.
  6. When using the latest version of the code make sure to download the latest versions of the corenlp-models, english-models, and english-models-kbp and include them in your CLASSPATH. If you are processing languages other than English, make sure to download the latest version of the models jar for the language you are interested in.

Build with Maven

  1. Make sure you have Maven installed, details here: https://maven.apache.org/
  2. If you run this command in the CoreNLP directory: mvn package , it should run the tests and build this jar file: CoreNLP/target/stanford-corenlp-4.5.4.jar
  3. When using the latest version of the code make sure to download the latest versions of the corenlp-models, english-extra-models, and english-kbp-models and include them in your CLASSPATH. If you are processing languages other than English, make sure to download the latest version of the models jar for the language you are interested in.
  4. If you want to use Stanford CoreNLP as part of a Maven project you need to install the models jars into your Maven repository. Below is a sample command for installing the Spanish models jar. For other languages just change the language name in the command. To install stanford-corenlp-models-current.jar you will need to set -Dclassifier=models. Here is the sample command for Spanish: mvn install:install-file -Dfile=/location/of/stanford-spanish-corenlp-models-current.jar -DgroupId=edu.stanford.nlp -DartifactId=stanford-corenlp -Dversion=4.5.4 -Dclassifier=models-spanish -Dpackaging=jar

Models

The models jars that correspond to the latest code can be found in the table below.

Some of the larger (English) models -- like the shift-reduce parser and WikiDict -- are not distributed with our default models jar. These require downloading the English (extra) and English (kbp) jars. Resources for other languages require usage of the corresponding models jar.

The best way to get the models is to use git-lfs and clone them from Hugging Face Hub.

For instance, to get the French models, run the following commands:

# Make sure you have git-lfs installed
# (https://git-lfs.github.com/)
git lfs install

git clone https://huggingface.co/stanfordnlp/corenlp-french

The jars can be directly downloaded from the links below or the Hugging Face Hub page as well.

Language Model Jar Last Updated
Arabic download (HF Hub) 4.5.6
Chinese download (HF Hub) 4.5.6
English (extra) download (HF Hub) 4.5.6
English (KBP) download (HF Hub) 4.5.6
French download (HF Hub) 4.5.6
German download (HF Hub) 4.5.6
Hungarian download (HF Hub) 4.5.6
Italian download (HF Hub) 4.5.6
Spanish download (HF Hub) 4.5.6

Thank you to Hugging Face for helping with our hosting!

Install by Gradle

If you don't know Gradle itself, see official site: https://gradle.org

Write the following in your build.gradle according to Maven Central:

dependencies {
    implementation 'edu.stanford.nlp:stanford-corenlp:4.5.5'
}

If you want to analyse English, add following:

    implementation "edu.stanford.nlp:stanford-corenlp:4.5.5:models"
    implementation "edu.stanford.nlp:stanford-corenlp:4.5.5:models-english"
    implementation "edu.stanford.nlp:stanford-corenlp:4.5.5:models-english-kbp"

If you use another version, replace "4.5.5" to a version you use.

Useful resources

You can find releases of Stanford CoreNLP on Maven Central.

You can find more explanation and documentation on the Stanford CoreNLP homepage.

For information about making contributions to Stanford CoreNLP, see the file CONTRIBUTING.md.

Questions about CoreNLP can either be posted on StackOverflow with the tag stanford-nlp, or on the mailing lists.

Extension points exported contracts — how you extend this code

ISemanticGraphEdgeEql (Interface)
Interface allowing for different routines to compare for equality over SemanticGraphEdges (typed lambdas in Java?) @auth [239 …
src/edu/stanford/nlp/semgraph/ISemanticGraphEdgeEql.java
TestSequenceModel (Interface)
(no doc) [8 implementers]
test/src/edu/stanford/nlp/sequences/BestSequenceFinderTest.java
RVFClassifier (Interface)
A simple interface for classifying and scoring data points with real-valued features. Implemented by the linear classif [8 …
src/edu/stanford/nlp/classify/RVFClassifier.java
ISomething (Interface)
(no doc) [45 implementers]
test/src/edu/stanford/nlp/util/MetaClassTest.java
ClassifierFactory (Interface)
A simple interface for training a Classifier from a Dataset of training examples. @author Dan Klein Templatized by Sar [7 …
src/edu/stanford/nlp/classify/ClassifierFactory.java
IteratorFromReaderFactory (Interface)
An IteratorFromReaderFactory is used to convert a java.io.Reader into an Iterator over the Objects of type T represented [21 …
src/edu/stanford/nlp/objectbank/IteratorFromReaderFactory.java
ViterbiParser (Interface)
The interface for Viterbi parsers. Viterbi parsers support getBestParse, which returns a best parse of the input, or <c [9 …
src/edu/stanford/nlp/parser/ViterbiParser.java

Core symbols most depended-on inside this repo

get
called by 10518
src/edu/stanford/nlp/util/Index.java
add
called by 6269
src/edu/stanford/nlp/util/Heap.java
assertEquals
called by 4622
src/edu/stanford/nlp/util/Sets.java
append
called by 4460
src/edu/stanford/nlp/ling/tokensregex/SequenceMatcher.java
size
called by 4168
src/edu/stanford/nlp/util/Heap.java
equals
called by 4041
src/edu/stanford/nlp/util/logging/RepeatedRecordHandler.java
info
called by 2668
src/edu/stanford/nlp/util/logging/Redwood.java
println
called by 2609
src/edu/stanford/nlp/util/logging/Redwood.java

Shape

Method 28,893
Class 3,238
Function 298
Interface 262
Enum 133

Languages

Java99%
TypeScript1%
Python1%

Modules by API surface

src/edu/stanford/nlp/pipeline/CoreNLPProtos.java7,543 symbols
src/edu/stanford/nlp/ling/CoreAnnotations.java455 symbols
src/edu/stanford/nlp/time/SUTime.java334 symbols
src/edu/stanford/nlp/ling/tokensregex/parser/TokenSequenceParser.java275 symbols
src/edu/stanford/nlp/loglinear/model/proto/GraphicalModelProto.java271 symbols
src/edu/stanford/nlp/tagger/maxent/ExtractorFramesRare.java194 symbols
src/edu/stanford/nlp/ling/tokensregex/SequencePattern.java184 symbols
src/edu/stanford/nlp/stats/Counters.java156 symbols
src/edu/stanford/nlp/semgraph/semgrex/GraphRelation.java141 symbols
src/edu/stanford/nlp/loglinear/model/proto/ConcatVectorProto.java133 symbols
src/edu/stanford/nlp/semgraph/SemanticGraph.java125 symbols
src/edu/stanford/nlp/ling/tokensregex/types/Expressions.java125 symbols

Dependencies from manifests, versioned

com.apple:AppleJavaExtensions1.4 · 1×
com.google.protobuf:protobuf-java3.25.5 · 1×
com.pholser:junit-quickcheck-core0.5 · 1×
com.pholser:junit-quickcheck-generators0.5 · 1×
com.sun.istack:istack-commons-runtime3.0.7 · 1×
com.sun.xml.bind:jaxb-impl2.4.0-b180830.0438 · 1×
de.jollyday:jollyday0.4.9 · 1×
edu.stanford.nlp:stanford-corenlp4.5.10 · 1×
jakarta.servlet:jakarta.servlet-api4.0.4 · 1×
javax.activation:javax.activation-api1.2.0 · 1×
javax.xml.bind:jaxb-api2.4.0-b180830.0359 · 1×
joda-time:joda-time2.13.0 · 1×

For agents

$ claude mcp add CoreNLP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact