This java program provides RESTful API for Apache OpenNLP library.
Default binding address is: 0.0.0.0:80
The web service consumes POST requests with raw data (text/plain) payload.
At the moment, it only supports English language (through official pre-trained models for the OpenNLP 1.5).
$ git clone https://github.com/rbehzadan/opennlp-service.git
cd opennlp-service
$ mkdir models
$ cd models
$ wget -i ../models.url
$ cd ..
$ mvn clean package
$ java -jar target/opennlp-service-1.0.jar
$ curl http://localhost -d "Grammar is useless because there is nothing to say."
You can change listening address and port by these two environment variables:
OPENNLP_SERVICE_HOSTOPENNLP_SERVICE_PORT
You can find some samples here.
$ cd opennlp-service
$ docker build -t opennlp .
$ docker run --name opennlp --rm -p 80:80 -d opennlp
To specify the listening port:
$ docker run -e OPENNLP_SERVICE_PORT=1234 -p 1234:1234 -d opennlp
If you're using Docker for Mac, you may have to specify a memory limit.
$ docker run --memory 4G -p 80:80 -d opennlp
Content type
Image
Digest
Size
300.4 MB
Last updated
almost 7 years ago
docker pull jpuck/opennlp-service