Stanford Core NLP Server up to date container
1.5K
CoreNLP Service is a Docker image that runs the CoreNLP Server.
To use this image, you need to have Docker installed. Once you have a running docker instance, you can use one of the prebuilt images from the docker hub.
For exemple you can use the latest version with this command :
docker run -p 9000:9000 antoinebriand/corenlp-server:latest
This will start the server on the local 9000 port of your machine. For production use, you should avoid using the latest tag.
The server will be deployed with 1Gb of RAM by default. To update this value, you can pass an environment variable on start:
#Start the sever with 4Gb of RAM
docker run -e CORENLP_MAX_MEMORY=4g -it antoinebriand/corenlp-server:latest
By default, the server will be started with the following annotators : tokenize,ssplit,ner.You can override this behavior by initializing the CORENLP_ANNOTATORS
env var :
docker run -e CORENLP_MAX_MEMORY=4g -e CORENLP_ANNOTATORS="tokenize,ssplit,pos,ner" -it antoinebriand/corenlp-server:latest
Since this image is stateless (no databases), it can be ran in a cluster as a microservice. If you have a running
Docker Swarm cluster you can create a service this way :
docker service create --name corenlp \
--publish 9000:9000 \
--env CORENLP_MAX_MEMORY=4g \
--env CORENLP_ANNOTATORS="tokenize,ssplit,pos,ner"\
antoinebriand/corenlp-server:latest
This will start a service on your cluster that expose Stanford on port 9000 with 4Gb of Ram. Since you are using Swarm you can also scale this service in order to take advantage of the built in load-balancing of Swarm :
#Start 10 instances of the server
docker service scale corenlp=10
Be careful ! If you started one service with 4Gb of RAM as in the exemple above, scaling the service will also create 4Gb services. Here it will require a maximum amount of 40Gb of RAM !
Stopping the service is done with this command :
docker service rm corenlp
Content type
Image
Digest
Size
443.3 MB
Last updated
about 9 years ago
docker pull antoinebriand/corenlp-server