Git Product home page Git Product logo

stanford-corenlp-docker's Introduction

stanford-corenlp-docker

This Dockerfile will build and run the most current release of the Stanford CoreNLP server in a docker container.

Usage

To download and run a prebuilt version of the CoreNLP server from Docker Hub locally at http://localhost:9000, just type:

docker run -p 9000:9000 nlpbox/corenlp

By default, CoreNLP will use up to 4GB of RAM. You can change this by setting the JAVA_XMX environment variable. Here, we're giving it 3GB:

docker run -e JAVA_XMX=3g -p 9000:9000 -ti nlpbox/corenlp

In order to build and run the container from scratch (e.g. if you want to use the most current release of Stanford CoreNLP, type:

docker buildx build -t corenlp https://github.com/NLPbox/stanford-corenlp-docker.git
docker run -p 9000:9000 corenlp

In another console, you can now query the CoreNLP REST API like this:

wget -q --post-data "Although they didn't like it, they accepted the offer." \
  'localhost:9000/?properties={"annotators":"parse","outputFormat":"json"}' \
  -O - | jq ".sentences[0].parse"

which will return this parse tree:

"(ROOT\n  (S\n    (SBAR (IN Although)\n      (S\n        (NP (PRP they))\n        (VP (VBD did) (RB n't)\n          (PP (IN like)\n            (NP (PRP it))))))\n    (, ,)\n    (NP (PRP they))\n    (VP (VBD accepted)\n      (NP (DT the) (NN offer)))\n    (. .)))"

If you need the full xml output and want to configure more parameters, try:

wget -q --post-data "Although they didn't like it, they accepted the offer." \
  'localhost:9000/?properties={ \
    "annotators":"tokenize,ssplit,pos,lemma,ner,parse", \
    "ssplit.eolonly":"false", "tokenize.whitespace":"true", \
    "outputFormat":"xml"}' \
  -O results.xml

stanford-corenlp-docker's People

Contributors

arne-cl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stanford-corenlp-docker's Issues

Suggestion for Running

I have tried running docker run -e JAVA_XMX=5g -p 9000:9000 -ti nlpbox/corenlp and it is crashing. No errors for information. Is there any suggestions for fixing this?

Does coreference annotator work in this image?

Have you managed to get the coref annotator to work? I'm seeing the image silently crashing when I bring up the GUI and add the coref annotator. Using latest corenlp, built as you suggest.

No crash with coref when I use the node package from https://github.com/gerardobort/node-corenlp, natively on an Intel Mac with openjdk-15.

wondering if we have a Java version issue, or a running out of memory, or something else.

How to store fetched models and lemmers

Thanks for making this! When I run this and hit the web server on http://localhost:8080 (mapped to port 9000), it fetches a bunch of models. Adding extra annotation libraries tend to crash the container (probably buggy Docker), but main problem is it re-fetches models on every run.

Where should I map a volume to store fetched models?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.